Opened 19 years ago
Closed 17 years ago
#3156 closed defect (wontfix)
[patch] [multidb] datetime with auto_now=True causes integrity error
| Reported by: | 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)
Change History (6)
by , 19 years ago
| Attachment: | datetimefield.patch added | 
|---|
by , 19 years ago
| Attachment: | datetimefield.2.patch added | 
|---|
oops, qrong order in patch. this should be correct.
comment:1 by , 19 years ago
| Triage Stage: | Unreviewed → Ready for checkin | 
|---|---|
| Version: | → other branch | 
note, this is multiple-db-support branch
comment:2 by , 19 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 , 18 years ago
| Triage Stage: | Ready for checkin → Someday/Maybe | 
|---|
Since multi-db is (currently) unmaintained, I'm marking this someday/maybe.
comment:4 by , 17 years ago
| Resolution: | → wontfix | 
|---|---|
| Status: | new → 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.
patch for DateTimeField