initial models file

This commit is contained in:
Sanj 2011-09-16 23:33:24 +05:30
parent 8997d41793
commit fc503cccf5

View File

@ -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.