Hi,
I wanto to set up a field with relation n to n where the selection table is in a different db from the relation table. The main table (on which I am using set_relation_n_n) is in the same db as the relation table.
Would the best way to do this be to override the get_relation_n_n_selection_array function in the model and add an optional parameter to trigger connection to a different db? Seems like perhaps this is too simple. Any comments welcome. Even if just to say "yep that seems best'!
Cheers,
Geoff

set_relation_n_n across two dbs
Started by jefc_uk, 23 May 2012 - 10:02 AM
- Single Page
Posted 23 May 2012 - 10:02 AM
Posted 23 May 2012 - 15:09 PM
Ugh... Got impatient so went ahead. I think I have this working, but in a VERY ugly way (too ashamed to say how
). Had to override get_field_types, relation_n_n_queries, get_relation_n_n_selection_array and get_relation_n_n_unselected_array.
Basically I'm checking for a specific table name and if found then prefixxing with the other db name... Yuck..
Still very much open to better suggestions!
Cheers,
Geoff

Basically I'm checking for a specific table name and if found then prefixxing with the other db name... Yuck..
Still very much open to better suggestions!
Cheers,
Geoff