views:

23

answers:

1

Two of my model's fields are "title" and "summary". Right now, "title" is the first field in the ModelAdmin's list_display, which makes it link to the change page. I have some other fields in list_display as well.

I'd like to make the admin change list page display "summary" under "title" in plain, unlinked text, in the same column as "title". Is this possible? I'm using Django 1.1.

Thanks

+1  A: 

Kind of. You can setup your own custom list_display objects to use. So for example, in your case you may do something like so:

def title_and_summary(obj):
    return "%s %s" % (obj.title, obj.summary)

Then within your admin class:

class MyAdmin(admin.ModelAdmin):
     list_display = (title_and_summary,)

More information can be found on the list_display documentation.

Bartek
This works perfectly! Setting allow_tags let me put in the formatting and line breaks that I needed. Thanks!
zbar