On Oct 11, 2010, at 10:44 PM, Bronwyn Woods wrote:
> I've recently realized the advantages of doing ad hoc queries using the
> getTempCursor method. This is working very well for simple things, but I'm
> wondering if it's possible to do something similar to get at child Bizobjs.
>
> For example, my form has a "Sections" Bizobj. "Sections" has a child
> "bizDance". I want to get the dance IDs linked to a given section ID. My
> current function is as follows. How could I rewrite this so that I don't
> wipe out the currently selected dataset for the Sections Bizobj?
>
> biz = self.getBizobj("Sections")
> biz.UserSQL = "select * from Sections where ID=%s" %key
> biz.requery()
> biz2 = biz.bizDance
> ks = []
> for rownum in biz2.bizIterator():
> ks.append(biz2.Record.danceID)
> return(ks)
Maybe something like this?
biz = self.getBizobj("Sections")
biz.moveToPK(key)
danceIDs = [rec["danceID"] for rec in biz.bizDance.bizDataIterator()]
If that's not what you're looking for, or you don't understand what
this code is doing, let me know.
-- Ed Leafe
_______________________________________________
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]