Opened 10 years ago

Closed 8 years ago

#3156 closed defect (wontfix)

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

Reported by: asvanberg@… Owned by: nobody
Component: Database layer (models, ORM) Version: other branch
Severity: major Keywords:
Cc: Triage Stage: Someday/Maybe
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 (2)

datetimefield.patch (638 bytes) - added by asvanberg@… 10 years ago.
patch for DateTimeField
datetimefield.2.patch (704 bytes) - added by asvanberg@… 10 years ago.
oops, qrong order in patch. this should be correct.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by asvanberg@…

Attachment: datetimefield.patch added

patch for DateTimeField

Changed 10 years ago by asvanberg@…

Attachment: datetimefield.2.patch added

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

comment:1 Changed 10 years ago by Gary Wilson <gary.wilson@…>

Triage Stage: UnreviewedReady for checkin
Version: other branch

note, this is multiple-db-support branch

comment:2 in reply to:  description Changed 10 years ago by gsf@…

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.

comment:3 Changed 9 years ago by Jacob

Triage Stage: Ready for checkinSomeday/Maybe

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

comment:4 Changed 8 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

With all the changes in the last couple of years to the internals, it's unlikely the multidb branch will be resurrected in its current form. Lots of advances in ideas have been made since that time, both in implementation and API.

Note: See TracTickets for help on using tickets.
Back to Top