On Aug 21, 2011, at 10:45 AM, Vineet Deodhar wrote:

> class PublicDistBizobj(dabo.biz.dBizobj):
>     def afterInit(self):
>         self.DataSource ='dist'
>         self.KeyField = 'distid'
> #        self.addFrom('dist')
> #        self.addField('distid')
> #        self.addField('distnm')
> #        self.addField('statid')
>         self.UserSQL = 'select distid,distnm,statid from stat'
>         self.NonUpdateFields = ['distid']
> 
> class PublicStatBizobj(dabo.biz.dBizobj):
>     def afterInit(self):
>         self.DataSource = 'stat'
> #        self.KeyField = 'statid'
> #        self.addFrom('stat')
> #        self.addField('statid')
> #        self.addField('statnm')
>         self.UserSQL = 'select statid,statnm from stat'
>         self.NonUpdateFields = ['statid']
> 
> statBizObj = PublicStatBizobj(oConn)
> distBizObj = PublicDistBizobj(oConn)
> 
> distBizObj.LinkField = 'statid'
> statBizObj.addChild(distBizObj)

        You are adding the distBizObj as a child of the statBizObj, but the 
statBizObj doesn't have the UserSQL that would support a dependent child 
relationship. The parameter error you are getting is because the framework is 
adding the parent's bizobj's key to the query params, but your SQL doesn't 
allow for params.

        I'm not sure why you want to go with UserSQL instead of the SQLBuilder 
methods, but keep in mind that once you decide to use UserSQL, you are 
responsible for making sure that the SQL code is correct.


-- 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]

Reply via email to