On Thursday 21 January 2010 07:22:49 am jvandal wrote:
> I have tried your code  and added these lines tothe child
> self.addField("fk_arcust")
>
> >               self.NonUpdateFields=["pkid"]
> >               self.LinkField = "fk_arcust"
> >               self.ParentLinkField ="pkid"
> >               self.FillLinkFromParent = True
>
> I don't get any errors but I don't  see any child data. Do I have to
> specify something in objects?, something I have overlooked?
>
> John-690 wrote:
> > On Tuesday 19 January 2010 05:12:55 pm jvandal wrote:
> >> I created a pillBizobj . I have a file pillBizobj that contains the
> >> record
> >> layout. In the edit dForm I have the statements that connect the
> >> database.
> >> I then created the child new_prescriptionsBizobj  and havae a file
> >> new_prescriptionsBizobj.py that contains the record layout. In the dFor
> >> edit of createBizobj I have added the connection statements.
> >>
> >> I see in the Using Data Environment screencast that it describes one
> >> Bizobj
> >> that describes both the parent and the child records.
> >> What gives?
> >
> > I am not aware of a screencast named "Using Data Environment".  So I
> > can't directly comment.
> >
> > However, there is no way to use one bizobj and setup a parent child
> > relationship.  See below of example code of a parent child relationship.
> > Note that the parent is the customer class and the child is the contacts
> > class.   A customer (maybe a company) can have many contacts - a one to
> > many
> > relationship.  In the child (the contact class) there are two lines of
> > the class that describes the relation so Dabo can maintain the
> > relationship.
> >
> > self.LinkField = "fk_arcust"
> > self.ParentLinkField ="pkid"
> >
> > So when you move the customer record pointer Dabo will retrieve the
> > contacts
> > data related to the customer.
> >
> >> #the contact table
> >> class PubliccontactsBizobj(dabo.biz.dBizobj):
> >>       def afterInit(self):
> >>               self.DataSource = "public.contacts"
> >>               self.KeyField = "pkid"
> >>               self.addFrom("public.contacts")
> >>               self.addField("firstname")
> >>               self.addField("phone")
> >>               self.addField("pkid")
> >>               self.addField("lastname")
> >>               self.addField("title")
> >>               self.addField("custno")
> >>               self.addField("continent")
> >>               self.addField("email")
> >>               self.addField("cont_note")
> >>               self.addField("fk_arcust")
> >>               self.NonUpdateFields=["pkid"]
> >>               self.LinkField = "fk_arcust"
> >>               self.ParentLinkField ="pkid"
> >>               self.FillLinkFromParent = True
> >>
> >> #the customer table
> >> class PublicarcustBizobj(dabo.biz.dBizobj):
> >>       def afterInit(self):
> >>               self.DataSource = "public.arcustomer"
> >>               self.addFrom("public.arcustomer")
> >>               self.KeyField = "pkid"
> >>               self.addField("czip")
> >>               self.addField("city")
> >>               self.addField("pkid")
> >>               self.addField("state")
> >>               self.addField("company")
> >>               self.addField("address1")
> >>               self.addField("address2")
> >>               self.addField("country")
> >>               self.addField("custno")
> >
> > Johnf

I don't top post if I can avoid it!

Can I assume you are in fact setting some control (like a grid) with the 
DataSource = thechild.

In a one to many (parent ->child) you need something to display the child 
records (the many) like a grid.

All the demo's and the tutorial setup a parent ->child relationship.  Have you 
tried following the code in the tutorial?

Are you hand coding - if so show us the code.

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]

Reply via email to