From ebb21440556d5d0db7537c09fe1780e71b058723 Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Tue, 18 Sep 2012 08:16:12 -0700 Subject: [PATCH] Responding to Eric's comment: yes Account.date_created should have auto_now_add not auto_add I modified migration and model. --- ...ld_account_card_last4__add_field_account_card_type__add_f.py | 2 +- payment/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/payment/migrations/0011_auto__add_field_account_card_last4__add_field_account_card_type__add_f.py b/payment/migrations/0011_auto__add_field_account_card_last4__add_field_account_card_type__add_f.py index f86f8fb7..c674066c 100644 --- a/payment/migrations/0011_auto__add_field_account_card_last4__add_field_account_card_type__add_f.py +++ b/payment/migrations/0011_auto__add_field_account_card_last4__add_field_account_card_type__add_f.py @@ -40,7 +40,7 @@ class Migration(SchemaMigration): # Adding field 'Account.date_created' db.add_column('payment_account', 'date_created', - self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=datetime.datetime(2012, 9, 17, 0, 0), blank=True), + self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime(2012, 9, 17, 0, 0), blank=True), keep_default=False) # Adding field 'Account.date_modified' diff --git a/payment/models.py b/payment/models.py index 9ff8c72a..1f5d5a6e 100644 --- a/payment/models.py +++ b/payment/models.py @@ -308,7 +308,7 @@ class Account(models.Model): card_country = models.CharField(max_length=2, null=True) # creation and last modified timestamps - date_created = models.DateTimeField(auto_now=True) + date_created = models.DateTimeField(auto_now_add=True) date_modified = models.DateTimeField(auto_now=True) date_deactivated = models.DateTimeField(null=True)