Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Managing many-to-many join table with Model Admin

Go to End

4 Posts   1923 Views

Nick Frandsen

Community Member, 2 Posts

20 January 2011 at 7:44pm

Hey Guys,

I have a many-to-many relationship that creates a corresponding join table in our db.

It would be nice to be able to add records to the join table through the cms using the model admin. I don't think Model Admin natively supports this because when setting managed_models you cant simply input a db table name that doesn't have a corresponding DataObject. It shouldnt be too difficult to extend the model admin to solve this problem, but there's a few different ways it could be done. has anyone else done it in a particularly elegant fashion that they would like to share? :)



Forum Moderator, 1899 Posts

20 January 2011 at 10:42pm

used this one often (had issues with latest ie)...

haven't tried this one...


Community Member, 60 Posts

21 January 2011 at 11:02am

Hi Nick,

I have two more:

ItemSetField, nice picker implementation for hasone, hasmany and manymany:

and of course the native implementation for managing ManyMany relations: ManyManyComplexTableField


Nick Frandsen

Community Member, 2 Posts

21 January 2011 at 11:26am

Edited: 21/01/2011 11:29am

Cheers guys! We have quite a few instances of both the models in involved in the many-to-many so will check out the suggested plugins to help manage them.