Opened 16 years ago
Closed 16 years ago
#10602 closed (invalid)
Proposal / Fix: auto_now should set a date for DateField
Reported by: | HuCy | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
For a DateField, if auto_now is enabled, a datetime value (datetime.datetime.now()) is inserted - which will make some queries more complicated.
The attached patch "fixes" that behaviour by inserting datetime.date.today() for DateField instances
and datetime.datetime.now() for DateTimeField instances.
But perhaps this is intended, since you can use datetime.date.today as the default parameter.
Attachments (1)
Change History (2)
by , 16 years ago
Attachment: | auto_now.diff added |
---|
comment:1 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I'm not sure what you mean by "makes queries more complicated"; since there doesn't seem to be a bug here I'm closing the ticket.