Let's say I have a simple blog app in Django 1.4:
class Post(models.Model):
title = …
published_on = …
tags = models.ManyToManyField('Tag')
class Tag(models.Model):
name = …
i.e. a post has many tags. On the Django admin, I get a nice little <select multi>
if I include tags
in the fields
for the PostAdmin
. Is there an easy way to include the list of the posts (as a simple <select multi>
) in the TagAdmin
? I tried putting fields = ['name', 'posts']
in the TagAdmin
and got an ImproperlyConfigured
error. (same result for post_set
).
I'm alright with Django, so could whip up a proper AdminForm and Admin object, but I'm hoping there a Right Way™ to do it.
through
attribute and set up few inlines in Admin. But that is far from beautiful solution. Take a look at this ticket: code.djangoproject.com/ticket/897 – Kannada