Ticket #1584: auto_now_add_fix.diff
File auto_now_add_fix.diff, 546 bytes (added by , 19 years ago) |
---|
-
django/db/models/fields/__init__.py
423 423 return Field.get_db_prep_lookup(self, lookup_type, value) 424 424 425 425 def pre_save(self, value, add): 426 if self.auto_now or ( self.auto_now_add and add):426 if self.auto_now or (not value and self.auto_now_add and add): 427 427 return datetime.datetime.now() 428 428 return value 429 429