On Sep 19, 5:09 am, Markos Gogoulos <[EMAIL PROTECTED]> wrote:
> on the admin panel I am trying to display both models of an
> ManyToManyField relationship. Say for example there are these two
> models:
>
> class Software(models.Model):
>     name = models.CharField(max_length=50)
>     categories = models.ManyToManyField(Category)
>
> class Category(models.Model):
>     name = models.CharField(max_length=50)

Assuming you mean two-way inlines, I discovered yesterday that it's
very easy to do this in Django 1.0 using the model's admin.py and the
new inlines system:

class SoftwareInline(admin.StackedInline):
        model = Software

class CategoryAdmin(admin.ModelAdmin):
        inlines = [SoftwareInline]

Besides StackedInline you also have TabularInline.

Jerry
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to