Ticket #1584: auto_now_add_fix.2.diff
File auto_now_add_fix.2.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 (self.auto_now_add and add and not value): 427 427 return datetime.datetime.now() 428 428 return value 429 429