4

I have a page build model that has a manytomanyfield All i want is to display the other columns of the manytomany field model

I have an image model with name and category fields and I want both to display on the admin page in an inline table with a filter instead of a many to many field.

fragmint
  • 322
  • 2
  • 6
  • Could you supply some sample code for your models? What do you mean by *filter instead many-to-many-field*? – jnns Mar 19 '11 at 14:10

1 Answers1

3

Use the inlines property of the ModelAdmin class.

First, define an InlineModelAdmin (the Django documentation covers it here). Then, set the inlines property of your page build model to a list or tuple with the class you created. You'll get exactly the behavior you want.

Luke Sneeringer
  • 9,270
  • 2
  • 35
  • 32
  • Thanks for the reply. I totally chucked the inlines idea and went a whole new route. In the end I just built a table with the fields and used some jquery to do a filter. it does exactly what i want. – fragmint May 16 '11 at 07:30