Conditional join inside list_items() / variable foreign_keys ?

edited April 2012 in Feature Requests
I know it's a strange question, but I'm trying to figure out if it would be possible to join tables and lazy-load models based on the value of a column. Imagine that a model has 2 fields:

- ext_id
- ext_table
and that you use the ext_id as the lookup id for the ext_table... also, i'm thinking that the foreign keys could be assigned run-time by the record object, something like

$this->_parent_model->foreign_keys = array('ext_id' => array('module_name' => $this->ext_table));
... or something like that.


Would that be possible? It's kind of an advanced thing to sort out, I know, but I don't see why it wouldn't be possible. Am I wrong??

Comments

  • edited 9:42AM
    I don't see why not
  • edited 9:42AM
    well there are a few issues actually, for example in the form_fields - how can the form builder know which foreign key to use during creation? ... also, what about the list view?

    actually there are a number of other problems, I guess i'm not good enough to solve a problem like this. I might have to go for a completely different approach...
Sign In or Register to comment.