5093 Posts in 1516 Topics by 1113 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1040 Views |
-
Managing many-to-many join table with Model Admin

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?
Cheers
-
Re: Managing many-to-many join table with Model Admin

20 January 2011 at 10:42pm
used this one often (had issues with latest ie)...
http://www.silverstripe.org/multiselectfield-module/haven't tried this one...
http://www.silverstripe.org/asm-multi-select-field-module/ -
Re: Managing many-to-many join table with Model Admin

21 January 2011 at 11:02am
Hi Nick,
I have two more:
ItemSetField, nice picker implementation for hasone, hasmany and manymany:
https://github.com/ajshort/silverstripe-itemsetfieldand of course the native implementation for managing ManyMany relations: ManyManyComplexTableField
http://api.silverstripe.org/2.4/forms/fields-relational/ManyManyComplexTableField.html
http://doc.silverstripe.org/sapphire/en/tutorials/5-dataobject-relationship-management#project-module-relationCheers
-
Re: Managing many-to-many join table with Model Admin

21 January 2011 at 11:26am Last edited: 21 January 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.
| 1040 Views | ||
|
Page:
1
|
Go to Top |



