Opened 18 years ago
Closed 18 years ago
#2513 closed defect (wontfix)
LazyDate better return date than datetime
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
We have model has a DateField called expire_date which set default to LazyDate(days=60), it works well in firefox, but under safari and IE it shows error when we save that object, because LazyDate.get_value method return datetime object, wich make the validation fails, I think it is better to return date object, which will be useful both to DateField and DateTimeField.
Attachments (2)
Change History (6)
by , 18 years ago
Attachment: | lazydate.patch added |
---|
comment:1 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 18 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Hm, for DateTimeField with default it sets time to 00:00 requiring users to manually set time everytime. Maybe add another class LazyDateTime ?
comment:4 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
LazyDate
is eventually going away, in favor of callable arguments, so I'm marking this as wontfix.
Old:
default=LazyDate()
.
New:
default=datetime.date.today
Old:
default=LazyDate(days=1)
New:
default=lambda: datetime.date.today() + datetime.timedelta(days=1)
patch for django 0.95