Opened 16 years ago
Closed 15 years ago
#10925 closed (fixed)
Django tutorial part 2: was_published_today example
Reported by: | rm | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.0 |
Severity: | Keywords: | tutorial | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The following code adding the short_description resides in models.py, which could be mentioned in the text above. Earlier code snippets were from admin.py, which led me to try editing the wrong module. Please clarify the text on the code location, otherwise the tutorial is just great!
BR,
Risto
def was_published_today(self): return self.pub_date.date() == datetime.date.today() was_published_today.short_description = 'Published today?'
Attachments (1)
Change History (3)
by , 16 years ago
Attachment: | 10925.diff added |
---|
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
note that the method is in models.py