Changeset 1275
- Timestamp:
- 11/17/05 09:26:50 (2 years ago)
- Files:
-
- django/trunk/django/contrib/admin/views/main.py (modified) (1 diff)
- django/trunk/docs/tutorial02.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/admin/views/main.py
r1208 r1275 362 362 header = func.short_description 363 363 except AttributeError: 364 header = func.__name__ 364 header = func.__name__.replace('_', ' ') 365 365 # Non-field list_display values don't get ordering capability. 366 366 raw_template.append('<th>%s</th>' % capfirst(header)) django/trunk/docs/tutorial02.txt
r1262 r1275 332 332 case of the ``was_published_today`` header, because sorting by the output of 333 333 an arbitrary method is not supported. Also note that the column header for 334 ``was_published_today`` is, by default, the name of the method. But you can 335 change that by giving that method a ``short_description`` attribute:: 334 ``was_published_today`` is, by default, the name of the method (with 335 underscores replaced with spaces). But you can change that by giving that 336 method a ``short_description`` attribute:: 336 337 337 338 def was_published_today(self): 338 339 return self.pub_date.date() == datetime.date.today() 339 was_published_today.short_description = ' Was published today'340 was_published_today.short_description = 'Published today?' 340 341 341 342
