On Nov 4, 2:50 pm, DavodM <david.mcc...@gmail.com> wrote: > Hello, > > I have a many to many relationship between 'Projects' and 'Tags' in my > app. > > In the admin screen I would like to be able to use the > filter_horizontal interface for adding/editing from both sides of the > relationship but I can only seem to get it for one or the other. > > I have tried the solution here > > http://stackoverflow.com/questions/1339409/, > > Which involves creating the projects_tags table manually in models > using a foreign key to each side (as you would do manually in SQL) and > then referring to it as the model for an AdminInline. > This allows me to display an inline to edit both sides of the > relationship but I don't seem to be able to display the inlines as > filter_horizontal because the relationships are now one to many. > > I have also tried a different approach from the documentation here > > http://docs.djangoproject.com/en/dev/ref/contrib/admin/#working-with-... > > Which says to use Tag.projects.through as the model for the > AdminInline > But I get an error saying that Tag.projects.through does not exist. (I > have checked and the SQL for the sqlite database and it is adding the > projects_tags table). > > So either I would like a way to display an inline from a many to many > relationship as filter_horizontal, or I need help getting the through > attribute to work. > > Any help would be much appreciated!
The 'through' solution only works in the latest version from trunk - it should have a 'new in development version' tag on it. If you need this functionality, it might be worth upgrading to that. -- DR. --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---