On Sun, May 17, 2009 at 5:15 AM, Ed Leafe <e...@leafe.com> wrote:

> On May 16, 2009, at 9:48 PM, Miguel Lopes wrote:
>
> > . But if you have different bizobjs from the same table
>
>         Ah, I think that this is the problem. A bizobj represents the
> business logic interface to a table, so while there may be more than
> one instance of a bizobj, there should not be more than one set of
> rules that govern a table.


I understand what you mean and, given I don't know Dabo I'm probably wrong.
But the bizobj also encapsulates relationships and this sparks the need for
several bizobjs from the same table, or not? Let me give you an example:

account.account_id = contact.account_id (1 Account, M Contact)
opportunity.opportunity_id = contact.opportunity_id (1 Opportunity, M
Contact)

So contacts are assigned to Acounts, but they may also be assigned to
Opportunities.
I have two diferent pages listing all Accounts and All Opportunities both
with a contacts tab. Since it's only possible to have one LinkField in a
bizobj (it wouldn't make since anyother way), this means:

class ContactAcctBizobj(dabo.biz.dBizobj):
    def afterInit(self):
        self.addFrom("contact")
        ...
        self.addField("contact_id")
        self.addField("account_id")

        self.DataSource = "contact"
        self.LinkField = "account_id"   # LinkField is different
        self.KeyField = "contact_id"

class ContactOpptyBizobj(dabo.biz.dBizobj):
    def afterInit(self):
        self.addFrom("contact")
        ...
        self.addField("contact_id")
        self.addField("opportunity_id")

        self.DataSource = "contact"
        self.LinkField = "opportunity_id"   # LinkField is different
        self.KeyField = "contact_id"

What am I missing here?


>
> > Does Bizobj.addChild work for bizobjs that have not been added to a
> > Form?
>
>         Sure. Bizobjs don't know anything about UI objects.
>

Great.


Miguel


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---
_______________________________________________
Post Messages to: Dabo-users@leafe.com
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/a19730800905170423r76e0a56ek1996d29bdccc6...@mail.gmail.com

Reply via email to