diff options
author | luxagraf <sng@luxagraf.net> | 2015-04-06 15:33:54 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2015-04-06 15:33:54 -0400 |
commit | b7d5d23b8ced32e6b5a1a45e0c1ef484f6f5d69f (patch) | |
tree | 4582142caf411ba1d284d3c227bd06f8cfb0abee /app/expenses | |
parent | b8943cb0e51b52f147c76530c2ca0f008e577a6c (diff) |
updated to django 1.8 using timezone for prepop today's date
Diffstat (limited to 'app/expenses')
-rw-r--r-- | app/expenses/models.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/expenses/models.py b/app/expenses/models.py index a01b8d7..746a459 100644 --- a/app/expenses/models.py +++ b/app/expenses/models.py @@ -1,4 +1,5 @@ from django.db import models +from django.utils import timezone from django.template.defaultfilters import slugify import datetime @@ -16,7 +17,7 @@ CATS = ( class Expense(models.Model): name = models.CharField(max_length=200) amount = models.DecimalField(max_digits=8, decimal_places=2) - date = models.DateTimeField(default=datetime.date.today()) + date = models.DateTimeField(default=timezone.now) notes = models.TextField(null=True, blank=True) category = models.CharField(max_length=2, choices=CATS, default=1) |