From fcc7fff5c2d731d10778662334da720e091e418c Mon Sep 17 00:00:00 2001 From: Girts Graudins Date: Wed, 5 Oct 2011 12:57:56 -0700 Subject: [PATCH] db changes --- trubox/deals/models.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/trubox/deals/models.py b/trubox/deals/models.py index 6758015..7ca4bcc 100755 --- a/trubox/deals/models.py +++ b/trubox/deals/models.py @@ -2,35 +2,42 @@ from django.db import models from django.contrib.auth.models import User from datetime import datetime +GROUP_CHOICES = ( + ('forming', 'Forming'), + ('negotiating', 'Negotiating'), + ('confirming', 'Confirming'), + ('closed', 'Closed') +) class ProductGroup(models.Model): url = models.URLField() + thumbnail_url = models.URLField() + fullimage_url = models.URLField() + bing_title = models.CharField(max_length=255) created_by = models.ForeignKey(User, related_name='created_group') name = models.CharField(max_length=255) - created_time = models.DateTimeField(default=datetime.now) description = models.TextField(blank=True) + state = models.CharField(choices=GROUP_CHOICES, max_length=255) + created_time = models.DateTimeField(default=datetime.now) end_time = models.DateTimeField() + negotiation_end_time = models.DateTimeField() + confirmation_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, max_length=64) - - - # Create your models here.