I'm using Django 1.2's new ManyToMany admin.TabularInline to display
related objects in the admin app, and it works great except I can't
figure out what to set the "ordering" property to so it can sort by
one of the cross-referenced field names.

For instance:

    class Foo(models.Model):
        name = models.CharField(max_length=100)

    class Bar(models.Model):
        title = models.CharField(max_length=100)
        foos = models.ManyToManyField(Foo)

    class FooBarInline(admin.TabularInline):
        model = Bar.foos.through
        ordering = ('name', )  # DOES NOT WORK
        raw_id_fields = ('name', )  # THROWS EXCEPTION

    class FooAdmin(admin.ModelAdmin):
        inlines = (FooBarInline, )

        class Meta:
            model = Foo


How can I get to the Foo.name field to order by it in the inline?

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

Reply via email to