From cc609943ac5868ca57d0f4f13488b4f0e5033b9c Mon Sep 17 00:00:00 2001 From: Sanj Date: Sat, 17 Sep 2011 21:37:53 +0530 Subject: [PATCH] add auto_now field --- trubox/deals/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trubox/deals/models.py b/trubox/deals/models.py index 9bb057b..0ab958a 100644 --- a/trubox/deals/models.py +++ b/trubox/deals/models.py @@ -1,11 +1,13 @@ from django.db import models from django.contrib.auth.models import User +from datetime import datetime class ProductGroup(models.Model): url = models.URLField() created_by = models.ForeignKey(User) name = models.CharField(max_length=255) + created_time = models.DateTimeField(default=datetime.now) description = models.TextField(blank=True) end_time = models.DateTimeField() is_locked = models.BooleanField(default=False)