Werner,

I believe the LinkField (and ParentLinkField) is for creating
parent-child relations. This is introduced in "Creating the Many:Many
Relationship between Recipes and Categories" section (which I had a
few problems following, mostly because I kept confusing "reccat" and
"reccats" ;-)

But these are mostly convenient if you require such logic, e.g. adding
a new child from a parent, mostly related to many:one or many:many
relations. An example is that you have a client and want to add a new
bill to this client (as opposed to creating a new bill and attaching a
_single_ client to this).

Note: The above was just my $0.5 targeted newbies who might be reading
this; I'm sure you already have that ground covered.


Cheers,


On 9 March 2011 12:10, Werner F. Bruhin <[email protected]> wrote:
> Lets say I have the following db table structure.
>
> MainTable
> Lookup1
> Lookup2
>
> I have a bizobj for each of these and now I like to have e.g. a grid
> with the following
>
> MainTable.name, Lookup1.name, Lookup2.name
>
> and a corresponding Edit page.
>
> I looked at the PyCon2010 and other entries on the wiki in relation to
> foreign key definitions but I do not get it.
>
> I thought I could maybe do something like this.
>
>     def afterInitAll(self):
>         app = self.Application
>         # child definitions
>         lookup1 = app.biz.Lookup1(app.dbConnection)
>         lookup1.LinkField = "fk_lookup1id"
>         self.addChild(lookup1)
>         lookup2 = app.biz.Lookup2(app.dbConnection)
>         lookup2.LinkField = "fk_lookup2id"
>         self.addChild(lookup2)
>
> Above runs without issue but now how do I use this in the e.g. the grid?
>
> Something like this "DataField="lookup1.name" would be nice but either I
> need to set something else or ....
>
> But looking at all the examples I see that one creates additional biz
> objects, so I think I am going down the wrong road with the above, but I
> also haven't seen a sample for a grid usage.
>
> I keep looking, but would appreciate some pointers.
>
> In the mean time I am installing MySql so I can try out PyCon2010 code
> out of the box.
>
> Werner
>
>
>
> _______________________________________________
> 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]
>
_______________________________________________
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