initial models file
This commit is contained in:
parent
8997d41793
commit
fc503cccf5
|
@ -1,3 +1,33 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
|
||||||
|
class ProductGroup(models.Model):
|
||||||
|
url = models.URLField()
|
||||||
|
created_by = models.ForeignKey(User)
|
||||||
|
name = models.CharField(max_length=255)
|
||||||
|
description = models.TextField(blank=True)
|
||||||
|
end_time = models.DateTimeField()
|
||||||
|
is_locked = models.BooleanField(default=False)
|
||||||
|
users = models.ManyToManyField(User, blank=True, through='UserGroup')
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
|
TIMELINE_CHOICES = (
|
||||||
|
('now', 'now'),
|
||||||
|
('10days' '10 days'),
|
||||||
|
('1month', '1 month'),
|
||||||
|
)
|
||||||
|
|
||||||
|
class UserGroup(models.Model):
|
||||||
|
user = models.ForeignKey(User)
|
||||||
|
product = models.ForeignKey(ProductGroup)
|
||||||
|
is_confirmed = models.BooleanField(default=False)
|
||||||
|
timeline_of_purchase = models.CharField(choices=TIMELINE_CHOICES)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user