Użytkownik sim napisał:
> On 2/7/2010 4:20 PM, Ed Leafe wrote:
>    
>> On Feb 7, 2010, at 8:54 AM, sim wrote:
>>
>>
>>      
>>> I have a table with multiple foreign keys.
>>>
>>> a) How can I mark multiple fields as the LinkField?
>>>
>>>        
>>      The LinkField is set on the child, or dependent, bizobj. A child can 
>> only be dependent on a single parent.
>>
>>      
> Lets say I have a 3 tables: Products, Users and UserProducts.
> UserProducts has 2 FKs , ProductID and UserID, showing which products
> are used by which user.
> I create 3 bizobjs, one for each table.
> Should UserProducts be a child of Users or Products?
>    

Hi,

If you want to have something like this:

UserProducts
     (   (______________ Users
     (________________ Products

I think your code should be (assume PK name in child tables are "pk_id"):

boUserProducts = app.biz.UserProducts()
boProducts = app.biz.Products(LinkField="pk_id", 
ParentLinkField="ProductID")
boUsers = app.biz.Users(LinkField="pk_id", ParentLinkField="UserID")
boUserProducts.addChild(boProducts)
boUserProducts.addChild(boUsers)

Unfortunately, Dabo doesn't support NULL parent child links :(
So, you probably receive exceptions for None FK fields.
But If you _really_ need this feature, I can send you custom classes that
extends Dabo to support this.

-- 
Regards
Jacek Kałucki

_______________________________________________
Post Messages to: [email protected]
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/[email protected]

Reply via email to