Commit fbc513f5 authored by Renán Sosa Guillen's avatar Renán Sosa Guillen

models for cart management

parent dad98aad
......@@ -3,6 +3,7 @@
## Create your models here.
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
......@@ -42,3 +43,18 @@ class Product_l2a(models.Model):
prod_l1c = models.ForeignKey(Product_l1c, on_delete=models.CASCADE)
identifier = models.CharField(max_length=50)
file_path = models.CharField(max_length=50)
class CartProduct(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
add_date = models.DateTimeField(auto_now=True)
prod_uuid = models.CharField(max_length=50)
prod_num = models.IntegerField()
prod_l1c = models.ForeignKey(Product_l1c, on_delete=models.CASCADE, null=True)
purchased = models.NullBooleanField()
class Purchase(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
pur_date = models.DateTimeField(auto_now=True) ## transaction date
prod_list = models.ManyToManyField(Product_l1c)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment