Opened 18 years ago

Closed 16 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: no UI/UX: no

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@… 18 years ago.
patch for DateTimeField
datetimefield.2.patch (704 bytes ) - added by asvanberg@… 18 years ago.
oops, qrong order in patch. this should be correct.

Download all attachments as: .zip

Change History (6)

by asvanberg@…, 18 years ago

Attachment: datetimefield.patch added

patch for DateTimeField

by asvanberg@…, 18 years ago

Attachment: datetimefield.2.patch added

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

comment:1 by Gary Wilson <gary.wilson@…>, 18 years ago

Triage Stage: UnreviewedReady for checkin
Version: other branch

note, this is multiple-db-support branch

in reply to:  description comment:2 by gsf@…, 18 years ago

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 by Jacob, 17 years ago

Triage Stage: Ready for checkinSomeday/Maybe

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

comment:4 by Malcolm Tredinnick, 16 years ago

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