Django tutorial part 2: was_published_today example
|Reported by:||rm||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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!
def was_published_today(self): return self.pub_date.date() == datetime.date.today() was_published_today.short_description = 'Published today?'