On Thursday, August 18, 2011 09:39:47 am Vineet Deodhar wrote:
> Dear John & other list-members,
> I have pasted the code on http://dabo.codepad.org/FBIoYWUe
> But it can't be run as it is.
> It requires web2py framework.
> Fortunately, its deployment is JUST copy & paste.
> If the code lines pasted there are not sufficient to debug, I can upload
> the entire code (25 MB) .zip file on yahoo & send the link in email. Pl.
> see if you can help in trapping the error.
>  
> Thanks,
> Vineet
> From: John Fabiani <jo...@jfcomputer.com>
> To: Vineet Deodhar <d_vin...@yahoo.com>; Dabo Users list
> <dabo-users@leafe.com> Sent: Thursday, 18 August 2011, 19:26
> Subject: Re: [dabo-users] Error in _getRecord() of dCursorMixin()
> 
> On Thursday, August 18, 2011 06:34:37 am Vineet Deodhar wrote:
> > Hi !
> > As stated earlier on this list, I am using standalone 'bizobj' class with
> > 'web2py'. I imported the entire dabo folder in my app.
> > Database server is MySQL DB.
> > There is a parent bizobj named as 'statBizObj'; (it has a child bizobj
> > named as 'distBizObj')
> > Upon encountering 'statBizObj.requery()' statement,
> > exception is thrown when it runs 'requeryAllChildren()' method.
> > I debugged via 'PyScripter' & could see that the bizobj can talk to the
> > database & fetch rows.
> > When it encounters '_getRecord()' method in 'dCursorMixin()', following
> > traceback is displayed:-- -------------------------Traceback (most recent
> > call last):
> > File "F:\py\web2py\gluon\restricted.py", line 192, in restricted
> > exec ccode in environment
> > File "F:/py/web2py/applications/mywheels/models/aafirst.py", line 54, in
> > <module> statBizObj.requery()
> > File "F:\py\web2py\site-packages\dabo\biz\dBizobj.py", line 1098, in
> > requery self.requeryAllChildren()
> > File "F:\py\web2py\site-packages\dabo\biz\dBizobj.py", line 1706, in
> > requeryAllChildren child.requery()
> > File "F:\py\web2py\site-packages\dabo\biz\dBizobj.py", line 1063, in
> > requery _childParamTuple = self.setChildLinkFilter()
> > File "F:\py\web2py\site-packages\dabo\biz\dBizobj.py", line 1130, in
> > setChildLinkFilter (self.Parent.IsAdding and not self.ParentLinkField):
> > File "F:\py\web2py\site-packages\dabo\biz\dBizobj.py", line 2528, in
> > _isAdding return self._CurrentCursor.IsAdding
> > File "F:\py\web2py\site-packages\dabo\db\dCursorMixin.py", line 2823, in
> > _getIsAdding getattr(self.Record, kons.CURSOR_TMPKEY_FIELD)
> > File "F:\py\web2py\site-packages\dabo\db\dCursorMixin.py", line 2872, in
> > _getRecord ret = self._cursorRecord = dabo.db._getRecord(self)
> > AttributeError: 'module' object has no attribute '_getRecord'
> > Code line in ''dCursorMixin()' is:
> > ret = self._cursorRecord = dabo.db._getRecord(self)
> >
> > 
> >
> > Pl. tell me where I may be mistaken.
> > (for advising on this error, if you need any additional info about my
> > code, pl. tell.)
> > Thanks,
> > ---Vineet-------------------------
> 
> Please post your code at
> http://dabo.codepad.org/
> Johnf


Please try moving a little code
        statBizObj = PublicStatBizobj(oConn)
    distBizObj = PublicDistBizobj(oConn)
    distBizObj.ParentLinkField = 'statid'
   
    distBizObj.LinkField = 'statid'
    distBizObj.FillLinkFromParent = True
        statBizObj.addChild(distBizObj)

You do not need to distBizObj.requery() - it is the child of the parent (stat) 
and the requery it is done for you in Dabo.
Also I believe you wanted to show all the records from 'dist' with the 
associated 'statid'.   I thought you understood
you needed to add a third datasource.  I believe I provide several ways to get 
that done.  Or you could reverse the
parent and child relationship and display all of the records from dist in a 
grid.  If the number of records in 
dist will be small (less than 1000) you will not have to touch the 'limit'.

Johnf 



--- 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/201108181124.59384.jo...@jfcomputer.com

Reply via email to