Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#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: UI/UX:


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 Changed 11 years ago by aCC

Use "default=meta.LazyDate()" instead of "auto_now_add=True".

comment:2 Changed 11 years ago by maurycypw@…

Component: Admin interfaceDocumentation
Owner: changed from Adrian Holovaty to Jacob

meta.LazyDate should be better documented. I can't see mentions about it in Model Reference.

comment:3 Changed 11 years ago by Adrian Holovaty

Summary: auto_now_add and upgradesDocument meta.LazyDate() technique

comment:4 Changed 11 years ago by anonymous

"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 Changed 11 years ago by anonymous

Setting "editable=False" seems to solve the issue about the creation time.

comment:6 Changed 11 years ago by Adrian Holovaty

Resolution: wontfix
Status: newclosed

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().

Note: See TracTickets for help on using tickets.
Back to Top