Użytkownik jvandal napisał:
> Here is my code from Bizobj. Do I use only one Bizobj . or do I create
> another Bizobj for the child reord.
>
> DoctorBizobj.addChild(doctorSpecialityizobj)
> I edit the object for tthe speciality_fk for name and source point to child
> field and record.
>
> =========================================
> class DoctorBizobj(dabo.biz.dBizobj):
> def afterInit(self):
> self.DataSource = "doctor"
> self.KeyField = "pkid"
> self.addFrom("doctor")
> self.addField("name")
> self.addField("fk_speciality")
> self.addField("pkid")
> self.LinkField = "fk_speciality"
> def validateRecord(self):
> """Returning anything other than an empty string from
> this method will prevent the data from being saved.
> """
> ret = ""
> # Add your business rules here.
> return ret
>
Personally, I prefer DataStructure method, so it could be something like
this:
def initProperties(self):
self.DataSource = "doctor"
self.KeyField = "pkid"
self.DataStructure = (
("pkid", "I", True, "doctor", "pkid"),
("name", "C", False, "doctor", "do_branch_id"),
("fk_speciality", "I", False, "doctor", "fk_speciality"),
("speciality_title", "C", False, "speciality",
"speciality_title")
)
self.addJoin(
"speciality",
"speciality.pkid = doctor.fk_speciality",
"LEFT"
)
I don't know name and fields your child table so I guess in this example.
--
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]