add button to admin change list at row level.

2,022 views
Skip to first unread message

Wayne

unread,
May 1, 2010, 11:29:13 PM5/1/10
to Django users
Hi,

We are trying to customize Django admin change list displaying model
objects. We want to add two buttons (Change, delete) to each row of
the record, something very similar to "Add" and "Change" buttons on
application list beside the model name. Could somebody give us some
hint on this? The "list_display" can only take existing fields, but
not the extra buttons we want to add, right? We do not want to provide
user with batch admin actions option. That is why we want to add
action to each row. Drop down actions menu is not our design
preference.

Thanks for your help.

Wayne

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Daniel Roseman

unread,
May 2, 2010, 4:06:57 AM5/2/10
to Django users
On May 2, 4:29 am, Wayne <wayneshen...@gmail.com> wrote:
> Hi,
>
> We are trying to customize Django admin change list displaying model
> objects. We want to add two buttons (Change, delete) to each row of
> the record, something very similar to "Add" and "Change" buttons on
> application list beside the model name. Could somebody give us some
> hint on this? The "list_display" can only take existing fields, but
> not the extra buttons we want to add, right? We do not want to provide
> user with batch admin actions option. That is why we want to add
> action to each row.  Drop down actions menu is not our design
> preference.
>
> Thanks for your help.
>
> Wayne

The docs explain how you can use arbitrary ModelAdmin methods in
list_display, which will do what you want.
http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display
--
DR.

Wayne

unread,
May 4, 2010, 9:11:10 PM5/4/10
to Django users
Thanks for your hint. It worked out pretty well.

Wayne

On May 2, 4:06 am, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On May 2, 4:29 am, Wayne <wayneshen...@gmail.com> wrote:
>
> > Hi,
>
> > We are trying to customize Django admin change list displaying model
> > objects. We want to add two buttons (Change, delete) to each row of
> > the record, something very similar to "Add" and "Change" buttons on
> > application list beside the model name. Could somebody give us some
> > hint on this? The "list_display" can only take existing fields, but
> > not the extra buttons we want to add, right? We do not want to provide
> > user with batch admin actions option. That is why we want to add
> > action to each row.  Drop down actions menu is not our design
> > preference.
>
> > Thanks for your help.
>
> > Wayne
>
> The docs explain how you can use arbitrary ModelAdmin methods in
> list_display, which will do what you want.http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#django.contri...
Reply all
Reply to author
Forward
0 new messages