#366 closed defect (wontfix)
Document meta.LazyDate() technique
Reported by: | anonymous | Owned by: | Jacob |
---|---|---|---|
Component: | Documentation | 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
Off course when you got auto_now_add=True on your DateTimeField it does not show when you add a new item. Thats not whats bugging me, but when i edit the item i want the date/time fields to show, so that i can edit them.
(I know about auto_now, but thats not what i'm after)
Change History (6)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Component: | Admin interface → Documentation |
---|---|
Owner: | changed from | to
meta.LazyDate should be better documented. I can't see mentions about it in Model Reference.
comment:3 by , 19 years ago
Summary: | auto_now_add and upgrades → Document meta.LazyDate() technique |
---|
comment:4 by , 19 years ago
"default=meta.LazyDate()" seems to set the DateTime to the time that the admin page gets loaded instead of when the object gets saved. This is not equivalent to how "auto_now_add=True" behaves.
comment:5 by , 19 years ago
Setting "editable=False" seems to solve the issue about the creation time.
comment:6 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
It won't be documented because it's going away -- in magic-removal, you can set default
to a callable, and you can override save()
.
Use "default=meta.LazyDate()" instead of "auto_now_add=True".