Ticket #17706: tuto02_short_description_ident.patch

File tuto02_short_description_ident.patch, 875 bytes (added by xbito, 4 years ago)

Short description example tutorial 2

  • docs/intro/tutorial02.txt

     
    356356underscores replaced with spaces). But you can change that by giving that
    357357method (in ``models.py``) a ``short_description`` attribute::
    358358
    359     def was_published_today(self):
    360         return self.pub_date.date() == datetime.date.today()
    361     was_published_today.short_description = 'Published today?'
     359    class Poll(models.Model):
     360    # ...
     361        def was_published_today(self):
     362            return self.pub_date.date() == datetime.date.today()
     363        was_published_today.short_description = 'Published today?'
    362364
    363365Edit your admin.py file again and add an improvement to the Poll change list page: Filters. Add the
    364366following line to ``PollAdmin``::
Back to Top