Author: Vineet Deodhar
Posted: 2011-11-25 07:58:44 Link
> Subject: Re: [dabo-users] many parents : one child
> Message-ID:<9617F637-8E98-4B15-82FB-535A874998DA@leafe.com>
> Content-Type: text/plain; charset=us-ascii
>
> On Nov 24, 2011, at 9:17 AM, Vineet Deodhar wrote:
>
>> In this case, what would you do (considering yourself in my shoes)?
>> In employees table, we have to link employee record to a category& also to a financial account.
> Generally, the category and accounts would be children of employee: their current values depend on the selected employee. When you select a different employee, the related records in category and account would be selected.
>
> -- Ed Leafe
But in this case, pk's of 'category' and 'accounts' are fk's in 'employee'.
And the chain of table-relationship is deeper than depicted in this
simple example.
Can there be any workaround for this kind of situation?
Jacek has come up with a suggestion as under --
===========
Simply, you can't. It's like paramecium, there is only one parent, no more.
But if you need such behaviour, you can override dBizobj.getParams()
method, e.g. for first relation use LinkField ("acid") and for the
second addWhere() method:
...
self.addWhere("catid = ?")
...
def getParams(self):
return (self.biz_cat.getFieldVal("catid"),)
But I never tried this, so there may be additional steps to take.
-- Regards Jacek Ka?ucki
===========
Can anybody pl. elaborate on this point?
I am not able to digest it.
Any help is highly appreciated.
Regards,
Vineet
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4ECF9104.7010105@yahoo.com
Author: Ed Leafe
Posted: 2011-11-25 11:25:07 Link
On Nov 25, 2011, at 6:58 AM, Vineet Deodhar wrote:
> But in this case, pk's of 'category' and 'accounts' are fk's in 'employee'.
> And the chain of table-relationship is deeper than depicted in this
> simple example.
>
> Can there be any workaround for this kind of situation?
I'm not sure what the issue is. If you add the category bizobj as a child of the employee, and set its ParentLinkField to 'catid', when you select an employee, the related category record will be selected. Same would work for accounts.
This is standard relational database stuff. What is different about your tables that prevents this from working?
-- Ed Leafe
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/F9C1185E-2429-4E56-BA28-2B9430AC43E1@leafe.com
Author: John Fabiani
Posted: 2011-11-25 18:41:08 Link
On Friday, November 25, 2011 10:25:07 AM Ed Leafe wrote:
> This is standard relational database stuff. What is different about your
> tables that prevents this from working?
I agree, tells what you are doing you'll get better help.
Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/6748395.hP9JQEeQ65@linux-12