Django

Code

Ticket #3156 (new)

Opened 2 years ago

Last modified 1 year ago

[patch] [multidb] datetime with auto_now=True causes integrity error

Reported by: asvanberg@gmail.com Assigned to: nobody
Milestone: Component: Database layer (models, ORM)
Version: other branch Keywords:
Cc: Triage Stage: Someday/Maybe
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

When adding a new object with a DateTimeField?(auto_now=True) an Integrity error is thrown because a NULL value is about to be inserted in a not null column. This is because the pre_save method of the DateTimeField? incorrectly calls the superclass of DateTime? instead of its own superclass. Patch provided.

Attachments

datetimefield.patch (0.6 kB) - added by asvanberg@gmail.com on 12/18/06 05:50:17.
patch for DateTimeField?
datetimefield.2.patch (0.7 kB) - added by asvanberg@gmail.com on 12/18/06 05:55:10.
oops, qrong order in patch. this should be correct.

Change History

12/18/06 05:50:17 changed by asvanberg@gmail.com

  • attachment datetimefield.patch added.

patch for DateTimeField?

12/18/06 05:55:10 changed by asvanberg@gmail.com

  • attachment datetimefield.2.patch added.

oops, qrong order in patch. this should be correct.

02/26/07 18:35:03 changed by Gary Wilson <gary.wilson@gmail.com>

  • version set to other branch.
  • stage changed from Unreviewed to Ready for checkin.

note, this is multiple-db-support branch

(in reply to: ↑ description ) 03/28/07 15:44:12 changed by gsf@perfectlygood.net

Replying to asvanberg@gmail.com:

When adding a new object with a DateTimeField?(auto_now=True) an Integrity error is thrown because a NULL value is about to be inserted in a not null column. This is because the pre_save method of the DateTimeField? incorrectly calls the superclass of DateTime? instead of its own superclass. Patch provided.

I think you mean "DateField?", not "DateTime?". Thanks for the patch.

12/04/07 13:52:47 changed by jacob

  • stage changed from Ready for checkin to Someday/Maybe.

Since multi-db is (currently) unmaintained, I'm marking this someday/maybe.


Add/Change #3156 ([patch] [multidb] datetime with auto_now=True causes integrity error)




Change Properties
Action