On Fri, Dec 12, 2008 at 4:41 PM, 3lancer.eu <[email protected]> wrote: > > Hi, > > Django-newbie needs your help, sorry for the lame question, but I > couldn't find the answer in docs. > > I have such a class: > > class GalleryAdmin(admin.ModelAdmin): > list_display = ('randomPhoto', '__unicode__', 'photoCount', > 'public') > list_display_links = ('randomPhoto', '__unicode__') > > in list_display: > - randomPhoto is a callable > - photoCount is a callable > - public is a regular field > > I want to change the column headers on the list page for the > callables, to, say 'Example photo' and 'Number of photos'.
Use the short_description attribute of the callable (be it a method or a function) as shown in the examples in the relevant section of the documentation: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#list-display (Strangely enough the attribute is only described in the code examples and is mentioned in part 2 of the tutorial. Maybe it's a good time to submit patch for the documentation to remediate this.) HTH, -- Ramiro Morales --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

