Opened 8 years ago

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

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by asvanberg@…

patch for DateTimeField

Changed 8 years ago by asvanberg@…

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

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

  • Triage Stage changed from Unreviewed to Ready for checkin
  • Version set to other branch

note, this is multiple-db-support branch

comment:2 in reply to: ↑ description Changed 8 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 7 years ago by jacob

  • Triage Stage changed from Ready for checkin to Someday/Maybe

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

comment:4 Changed 6 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from new to closed

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