Opened 19 years ago

Closed 19 years ago

Last modified 18 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: 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 aCC, 19 years ago

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

comment:2 by maurycypw@…, 19 years ago

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 by Adrian Holovaty, 19 years ago

Summary: auto_now_add and upgradesDocument meta.LazyDate() technique

comment:4 by anonymous, 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 anonymous, 19 years ago

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

comment:6 by Adrian Holovaty, 19 years ago

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