Re: presenting a manytomany relationship in a tabular way

66 views
Skip to first unread message

Melvyn Sopacua

unread,
Jul 31, 2012, 9:44:51 AM7/31/12
to django...@googlegroups.com
On 31-7-2012 11:33, goabbear wrote:

> There's 3 tables, user(name, mail), mailinglist(name) and an intermediate
> table subscription where are stored all the users joining some
> mailinglists.
> How can I present the "subscription" table to the admins like a
> spreadsheet, where the first column represents the users emails and one
> other column is a mailinglist name. On each row, the admin can activate the
> subscription for each user by checking a checkbox?

You need a combination of list_display and modeladmin actions:
<https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display>
<https://docs.djangoproject.com/en/1.4/ref/contrib/admin/actions/>

Alternatively, you can use list_editable:
<https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_editable>

--
Melvyn Sopacua

goabbear

unread,
Aug 3, 2012, 9:07:26 AM8/3/12
to django...@googlegroups.com
Hi,
thanks for the links, I have look at these docs but I can't figure out how to mix actions with a spreadsheet like presentation :-/
Is it possible to create admin forms like we can standards forms?
Another way I could try is to use filter_horizontal (I like this presentation), but for a m2m relation, just 1 entity can be presented with this widget, not the other side, or I do something wrong?
Reply all
Reply to author
Forward
0 new messages