Opened 10 years ago

Closed 10 years ago

Last modified 9 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:

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

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

comment:2 Changed 10 years ago by maurycypw@…

  • Component changed from Admin interface to Documentation
  • Owner changed from adrian to jacob

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

comment:3 Changed 10 years ago by adrian

  • Summary changed from auto_now_add and upgrades to Document meta.LazyDate() technique

comment:4 Changed 10 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 10 years ago by anonymous

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

comment:6 Changed 10 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to 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().

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