I guess I'll have to read all of the tutorial before getting it, because right now, I stopped at bizobj relations and its not very clear.
For example : > Dabo makes it easy to use the key relationship. The foreign keys relationships ? > bizobj.ParentLinkField = "pkid" # the unique customer key This maps to CustomerTable.Columns.PrimarKey ? (pseudo code) > bizobj.LinkField = "fk_clientid" # the foreign key in orders This maps to OrdersTable.Columns.ForeignKeyToClient ? > bizobj.FillLinkFromParent = True # a way to track new records What happens if this is set to False ? > After you define the relationship Dabo takes care of keeping the relationship > valid i.e : no orders with that have no customer or an unknown customer_id ? > If you move to a new customer record the orders table will follow. You mean in the UI ? If that's what you mean, setting bizobj.FillLinkFromParent to False in the orders table will not make the orders table follow (in the UI) ? Sorry for asking these questions before reading all through the tutorial. There are great chances that I may answer myself after doing that :) so feel free to ignore my comments. Cheers, --- On Thu, 10/28/10, John Fabiani <[email protected]> wrote: > From: John Fabiani <[email protected]> > Subject: Re: [dabo-users] Adding an immediate example about BizObjs relations > in the tutorial > To: "Dabo Users list" <[email protected]> > Date: Thursday, October 28, 2010, 9:47 AM > On Thursday, October 28, 2010 > 01:06:30 am chaouche yacine wrote: > > Hello, > > > > I discovered dabo yesterday, I haven't coded anything > yet, just following > > the pycon2010 tutorial. I have a documentation request > about BizObj > > relations. I didn't understand them. If the tutorial > could give an > > immediate code example on how to set a relation b/w > two bizobjs that would > > be great. In comparison, I found elixir's > documentation about that subject > > very clear and straightforward and understood it from > my first reading > > http://elixir.ematia.de/trac/wiki/TutorialDivingIn#a4.Simplerelationships. > > > > I look forward into using Dabo for my next project, I > hope to hear from you > > soon. > > > > Cheers, > > > > Y.Chaouche > > > I think you are right - I don't see anything on the wiki > that explains how > bizobj's can be related. It's a relatively simple > thing to understand. I'm > guessing it's the 'how' that is the issue. > > A little background: > Tables in a database are often related to each other with > keys. > A primary key is a column (or a combination of columns) > with a unique value > for each row. Each primary key value must be unique within > the table. The > purpose is to bind data together, across tables, without > repeating all of the > data in every table. > > Take the case where we have a customer with multiple > orders. The customer has > a unique primary key and in each of the orders there is a > field containing the > customer key (a foreign key). We can then relate the > foreign key in the > orders to the customer with same primary key. BTW > this is exactly how SQL > joins work. This is often called a parent child > relationship. > > > What Dabo does: > Dabo makes it easy to use the key relationship. Dabo > provides several attrb's > to help define the relationships. Each bizobj is > defined in your code. It > does not matter if you hand code the definition or are > using either the > ClassDesigner or the AppWizard. The table you want to > use is defined. You > can then tell framework what special relationships are > required. > > So in my definition of my orders table (a child of > customers) I have some like > below: > > bizobj.ParentLinkField = "pkid" # the unique customer > key > bizobj.LinkField = "fk_clientid" # the > foreign key in orders > bizobj.FillLinkFromParent = True # a way to track new > records > > After you define the relationship Dabo takes care of > keeping the relationship > valid. If you move to a new customer record the > orders table will follow. If > you require info on how Dabo does this - you'll need to > read the source. > > As always feel free to correct me. This is just how I > think about the > subject. > > Johnf > > > > > > _______________________________________________ > 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]
