Browse Source

Set document date an editable field

Jocelyn Delande 9 years ago
parent
commit
a74028b4db
1 changed files with 3 additions and 1 deletions
  1. 3 1
      costs/models.py

+ 3 - 1
costs/models.py

@@ -1,3 +1,5 @@
+import datetime
+
 from django.conf import settings
 from django.core.exceptions import ValidationError
 from django.core.urlresolvers import reverse
@@ -12,7 +14,7 @@ class Document(models.Model):
 
     name = models.CharField(max_length=130)
     comment = models.TextField(blank=True)
-    date = models.DateField(auto_now_add=True)
+    date = models.DateField(default=datetime.datetime.now)
     type = models.CharField(max_length=10, choices=(
         (TYPE_FACT, 'relevé'),
         (TYPE_PLAN, 'scénario/estimation'),