Paul, I was able to get two bzobjects working on the same table independently by using your technique of creating 2 fictitious datasource names and only adding the primary bzobj to the form. That was some black magic. The other method you suggested of not putting in the addField and friends statements I didn't quite get -- upper division work for sure! As long as I have a method that works, that's all that matters. Thanks for your brilliance again. Steve Rose On Thu, Aug 7, 2008 at 3:27 PM, <[EMAIL PROTECTED]> wrote:
> Send Dabo-users mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > http://leafe.com/mailman/listinfo/dabo-users > or, via email, send a message with subject or body 'help' to > [EMAIL PROTECTED] > > You can reach the person managing the list at > [EMAIL PROTECTED] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Dabo-users digest..." > > > Today's Topics: > > 1. Multiple Biz Object with same Datasource (Paul McNary) > 2. Independent Bizobjects??? (Steve Rose) > 3. Re: Independent Bizobjects??? (Paul McNett) > 4. Re: Multiple Biz Object with same Datasource (Paul McNett) > 5. Re: Independent Bizobjects??? (Paul McNary) > 6. Re: Independent Bizobjects??? (Paul McNett) > 7. Re: Independent Bizobjects??? (johnf) > 8. Re: Independent Bizobjects??? (Nate Lowrie) > 9. Re: Multiple Biz Object with same Datasource (Nate Lowrie) > 10. Re: Independent Bizobjects??? (Paul McNett) > 11. Re: Independent Bizobjects??? (Paul McNett) > 12. Re: Independent Bizobjects??? (johnf) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 07 Aug 2008 16:29:19 -0500 > From: Paul McNary <[EMAIL PROTECTED]> > Subject: [dabo-users] Multiple Biz Object with same Datasource > To: Dabo Users list <[email protected]> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hello > > If I have to Biz objects with the same datasource but different JOIN > options, how do I reference them? > > Thank you > Paul McNary > [EMAIL PROTECTED] > > > > > ------------------------------ > > Message: 2 > Date: Thu, 7 Aug 2008 14:33:48 -0700 > From: "Steve Rose" <[EMAIL PROTECTED]> > Subject: [dabo-users] Independent Bizobjects??? > To: [email protected] > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1 > > Thanks for your patience guys. I can now work with the cats and dogs > tables > with 2 independent bizobjs. But I think I'm missing some deeper > understanding of bizobjects. If you can set me straight on the following > example, I think I might get it through my thick head: > > Say I have a form with 2 grids and 1 bizobj, "bizcats", datasourced to a > "cats" table. I want the first grid to display ALL the cat records in the > table. The second grid will display only results from queries run against > the same cats table ("select * from cats where color = 'black' "). How do > I > set things up so that a query on the cats table does not affect the results > seen in the first grid, which should still display all records in the cats > table? So, I guess what I'm trying to get at is how can I work with the > same table and have multiple, independent views of it on the form's > controls. Coming from a dBase background, I'd just use multiple query > objects to do the job, but I can't change my thinking enough to do this > task > using bizobjs. Hope this make sense. > > Steve Rose > > > --- StripMime Report -- processed MIME parts --- > multipart/alternative > text/plain (text body -- kept) > text/html > --- > > > > ------------------------------ > > Message: 3 > Date: Thu, 07 Aug 2008 14:44:18 -0700 > From: Paul McNett <[EMAIL PROTECTED]> > Subject: Re: [dabo-users] Independent Bizobjects??? > To: Dabo Users list <[email protected]> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=UTF-8; format=flowed > > Steve Rose wrote: > > Thanks for your patience guys. I can now work with the cats and dogs > tables > > with 2 independent bizobjs. But I think I'm missing some deeper > > understanding of bizobjects. If you can set me straight on the following > > example, I think I might get it through my thick head: > > > > Say I have a form with 2 grids and 1 bizobj, "bizcats", datasourced to a > > "cats" table. I want the first grid to display ALL the cat records in > the > > table. The second grid will display only results from queries run > against > > the same cats table ("select * from cats where color = 'black' "). How > do I > > set things up so that a query on the cats table does not affect the > results > > seen in the first grid, which should still display all records in the > cats > > table? So, I guess what I'm trying to get at is how can I work with the > > same table and have multiple, independent views of it on the form's > > controls. Coming from a dBase background, I'd just use multiple query > > objects to do the job, but I can't change my thinking enough to do this > task > > using bizobjs. Hope this make sense. > > Just instantiate more than one instance of the bizobj, and work with > them independently. You'll have to give them unique DataSource > properties, however, so that dForm doesn't get confused. Example: > > {{{ > from bizcats import BizCats > > class MyForm(dabo.ui.dForm): > def afterInit(self): > app = self.Application > self.bizCatsAll = BizCats(app.dbConnection, DataSource="cats_all") > self.bizCatsSome = BizCats(app.dbConnection, DataSource="cats_some") > self.addBizobj(self.bizCatsAll) > self.addBizobj(self.bizCatsSome) > }}} > > Now, set the DataSources of your 2 grids appropriately. > > Paul > > > > > ------------------------------ > > Message: 4 > Date: Thu, 07 Aug 2008 14:45:17 -0700 > From: Paul McNett <[EMAIL PROTECTED]> > Subject: Re: [dabo-users] Multiple Biz Object with same Datasource > To: [EMAIL PROTECTED], Dabo Users list <[email protected]> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=UTF-8; format=flowed > > Paul McNary wrote: > > If I have to Biz objects with the same datasource but different JOIN > > options, how do I reference them? > > See my response from a minute ago to Steve Rose: instantiate two > instances of the bizobj(s) but make sure they have different DataSource > values. > > Paul > > > > > ------------------------------ > > Message: 5 > Date: Thu, 07 Aug 2008 16:49:11 -0500 > From: Paul McNary <[EMAIL PROTECTED]> > Subject: Re: [dabo-users] Independent Bizobjects??? > To: Dabo Users list <[email protected]> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Paul McNett wrote: > > > > Just instantiate more than one instance of the bizobj, and work with > > them independently. You'll have to give them unique DataSource > > properties, however, so that dForm doesn't get confused. Example: > > > > {{{ > > from bizcats import BizCats > > > > class MyForm(dabo.ui.dForm): > > def afterInit(self): > > app = self.Application > > self.bizCatsAll = BizCats(app.dbConnection, DataSource="cats_all") > > self.bizCatsSome = BizCats(app.dbConnection, DataSource="cats_some") > > self.addBizobj(self.bizCatsAll) > > self.addBizobj(self.bizCatsSome) > > }}} > > > > Now, set the DataSources of your 2 grids appropriately. > > > > Paul > > > > So the DataSource name doesn't have to match the table name? > They are just arbitrary descriptive names? > I was under the assumption yhat they were the actual table name. The > table(s) used are what is defined in the FROM statements in the biz object? > > Do I understand correctly now? > > Thanks > > Paul McNary > [EMAIL PROTECTED] > > > > > ------------------------------ > > Message: 6 > Date: Thu, 07 Aug 2008 15:04:50 -0700 > From: Paul McNett <[EMAIL PROTECTED]> > Subject: Re: [dabo-users] Independent Bizobjects??? > To: [EMAIL PROTECTED], Dabo Users list <[email protected]> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=UTF-8; format=flowed > > Paul McNary wrote: > > Paul McNett wrote: > >> Just instantiate more than one instance of the bizobj, and work with > >> them independently. You'll have to give them unique DataSource > >> properties, however, so that dForm doesn't get confused. Example: > >> > >> {{{ > >> from bizcats import BizCats > >> > >> class MyForm(dabo.ui.dForm): > >> def afterInit(self): > >> app = self.Application > >> self.bizCatsAll = BizCats(app.dbConnection, DataSource="cats_all") > >> self.bizCatsSome = BizCats(app.dbConnection, > DataSource="cats_some") > >> self.addBizobj(self.bizCatsAll) > >> self.addBizobj(self.bizCatsSome) > >> }}} > >> > >> Now, set the DataSources of your 2 grids appropriately. > >> > >> Paul > >> > > > > So the DataSource name doesn't have to match the table name? > > They are just arbitrary descriptive names? > > I was under the assumption yhat they were the actual table name. The > > table(s) used are what is defined in the FROM statements in the biz > object? > > > > Do I understand correctly now? > > If you never fill in addField() and friends, or you do but don't give it > an explicit table name, Dabo will use DataSource to determine the > backend table name. > > Don't let Dabo do that. :) > > Paul > > > > > ------------------------------ > > Message: 7 > Date: Thu, 7 Aug 2008 15:11:09 -0700 > From: johnf <[EMAIL PROTECTED]> > Subject: Re: [dabo-users] Independent Bizobjects??? > To: Dabo Users list <[email protected]> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > On Thursday 07 August 2008 03:04:50 pm Paul McNett wrote: > > If you never fill in addField() and friends > > I don't understand that statement - enlighten me???? How can you not > fill-in > the addField()? > > -- > John Fabiani > > > > > ------------------------------ > > Message: 8 > Date: Thu, 7 Aug 2008 16:14:59 -0600 > From: "Nate Lowrie" <[EMAIL PROTECTED]> > Subject: Re: [dabo-users] Independent Bizobjects??? > To: "Dabo Users list" <[email protected]> > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1 > > On Thu, Aug 7, 2008 at 4:04 PM, Paul McNett <[EMAIL PROTECTED]> wrote: > > Paul McNary wrote: > >> Paul McNett wrote: > >>> Just instantiate more than one instance of the bizobj, and work with > >>> them independently. You'll have to give them unique DataSource > >>> properties, however, so that dForm doesn't get confused. Example: > >>> > >>> {{{ > >>> from bizcats import BizCats > >>> > >>> class MyForm(dabo.ui.dForm): > >>> def afterInit(self): > >>> app = self.Application > >>> self.bizCatsAll = BizCats(app.dbConnection, DataSource="cats_all") > >>> self.bizCatsSome = BizCats(app.dbConnection, > DataSource="cats_some") > >>> self.addBizobj(self.bizCatsAll) > >>> self.addBizobj(self.bizCatsSome) > >>> }}} > >>> > >>> Now, set the DataSources of your 2 grids appropriately. > > I like to do: > > {{{ > from bizcats import BizCats > > class MyForm(dabo.ui.dForm): > def afterInit(self): > app = self.Application > self.bizCatsAll = BizCats(app.dbConnection) > self.bizCatsSome = BizCats(app.dbConnection) > self.addBizobj(self.bizCatsAll) > }}} > > Set the DataSource inside the BizCats object to "cats" and just don't > add it to the form. You can then set your first grid DataSource to > "cats" to set it to the all bizobj and the 2nd grid you can set by > doing "self.myGrid2.DataSource = self.bizCatsSome". I am not sure > what Paul is getting at with the not filling in the addField... > > Nate L. > > > > > ------------------------------ > > Message: 9 > Date: Thu, 7 Aug 2008 16:16:06 -0600 > From: "Nate Lowrie" <[EMAIL PROTECTED]> > Subject: Re: [dabo-users] Multiple Biz Object with same Datasource > To: "Dabo Users list" <[email protected]> > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1 > > On Thu, Aug 7, 2008 at 3:45 PM, Paul McNett <[EMAIL PROTECTED]> wrote: > > Paul McNary wrote: > >> If I have to Biz objects with the same datasource but different JOIN > >> options, how do I reference them? > > > > See my response from a minute ago to Steve Rose: instantiate two > > instances of the bizobj(s) but make sure they have different DataSource > > values. > > I provided a 2nd way in that email thread that allows you to use the > same DataSource. > > Nate L. > > > > > ------------------------------ > > Message: 10 > Date: Thu, 07 Aug 2008 15:18:00 -0700 > From: Paul McNett <[EMAIL PROTECTED]> > Subject: Re: [dabo-users] Independent Bizobjects??? > To: Dabo Users list <[email protected]> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=UTF-8; format=flowed > > johnf wrote: > > On Thursday 07 August 2008 03:04:50 pm Paul McNett wrote: > >> If you never fill in addField() and friends > > > > I don't understand that statement - enlighten me???? How can you not > fill-in > > the addField()? > > If you don't fill in addField(), then Dabo constructs a query like: > > select * from <self.DataSource> > > As I said, don't do it! > > Paul > > > > > ------------------------------ > > Message: 11 > Date: Thu, 07 Aug 2008 15:20:17 -0700 > From: Paul McNett <[EMAIL PROTECTED]> > Subject: Re: [dabo-users] Independent Bizobjects??? > To: Dabo Users list <[email protected]> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=UTF-8; format=flowed > > Nate Lowrie wrote: > > On Thu, Aug 7, 2008 at 4:04 PM, Paul McNett <[EMAIL PROTECTED]> wrote: > >> Paul McNary wrote: > >>> Paul McNett wrote: > >>>> Just instantiate more than one instance of the bizobj, and work with > >>>> them independently. You'll have to give them unique DataSource > >>>> properties, however, so that dForm doesn't get confused. Example: > >>>> > >>>> {{{ > >>>> from bizcats import BizCats > >>>> > >>>> class MyForm(dabo.ui.dForm): > >>>> def afterInit(self): > >>>> app = self.Application > >>>> self.bizCatsAll = BizCats(app.dbConnection, > DataSource="cats_all") > >>>> self.bizCatsSome = BizCats(app.dbConnection, > DataSource="cats_some") > >>>> self.addBizobj(self.bizCatsAll) > >>>> self.addBizobj(self.bizCatsSome) > >>>> }}} > >>>> > >>>> Now, set the DataSources of your 2 grids appropriately. > > > > I like to do: > > > > {{{ > > from bizcats import BizCats > > > > class MyForm(dabo.ui.dForm): > > def afterInit(self): > > app = self.Application > > self.bizCatsAll = BizCats(app.dbConnection) > > self.bizCatsSome = BizCats(app.dbConnection) > > self.addBizobj(self.bizCatsAll) > > }}} > > > > Set the DataSource inside the BizCats object to "cats" and just don't > > add it to the form. You can then set your first grid DataSource to > > "cats" to set it to the all bizobj and the 2nd grid you can set by > > doing "self.myGrid2.DataSource = self.bizCatsSome". I am not sure > > what Paul is getting at with the not filling in the addField... > > This works, too. > > The only reason I mentioned not filling in addField() was in explaining > a case where DataSource tells Dabo the name of the backend table. > > Paul > > > > > ------------------------------ > > Message: 12 > Date: Thu, 7 Aug 2008 15:27:14 -0700 > From: johnf <[EMAIL PROTECTED]> > Subject: Re: [dabo-users] Independent Bizobjects??? > To: Dabo Users list <[email protected]> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > On Thursday 07 August 2008 03:18:00 pm Paul McNett wrote: > > johnf wrote: > > > On Thursday 07 August 2008 03:04:50 pm Paul McNett wrote: > > >> If you never fill in addField() and friends > > > > > > I don't understand that statement - enlighten me???? How can you not > > > fill-in the addField()? > > > > If you don't fill in addField(), then Dabo constructs a query like: > > > > select * from <self.DataSource> > > > > As I said, don't do it! > > > > Paul > > I didn't know that. I guess because I never do that! > > > > -- > John Fabiani > > > > > ------------------------------ > > _______________________________________________ > Dabo-users mailing list > [email protected] > http://leafe.com/mailman/listinfo/dabo-users > Searchable Archives: http://leafe.com/archives/search/dabo-users > > > End of Dabo-users Digest, Vol 50, Issue 14 > ****************************************** > --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- _______________________________________________ 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]
