Ed Leafe <[EMAIL PROTECTED]> writes:

> 

> 
>       Try this: add a debugging line to dBizobj.requery():
> 
> 788           # run the requery
> 789           uiException = None
> 790           cursor = self._CurrentCursor
> 791           try:
> 792                   cursor.requery(params)
>                       print "REQUERY", self.DataSource
> 793
> 794           except dException.ConnectionLostException, e:
> 
>       Run your code again, and verify that the requery is actually being run.
> 



adding :                # run the requery
                uiException = None
                cursor = self._CurrentCursor
                try:
                        cursor.requery(params)
                        print "REQUERY", self.DataSource

                except dException.ConnectionLostException, e:

generated the following error:


Traceback (most recent call last):
  File "fmrecs05.py", line 22, in ?
    main()
  File "fmrecs05.py", line 15, in main
    app.start()
  File "C:\projects\dabo\dabo\dApp.py", line 284, in start

    self.setup()
  File "C:\projects\dabo\dabo\dApp.py", line 249, in setup

    self.initUIApp()

  File "C:\projects\dabo\dabo\dApp.py", line 276, in initUIApp

    self.uiApp.setup()

  File "C:\projects\dabo\dabo\ui\uiwx\uiApp.py", line 232, in setup

    frm = self.dApp.MainForm = dabo.ui.createForm(mfc)

  File "C:\projects\dabo\dabo\ui\uiwx\__init__.py", line 1019, in createForm

    frm = cls(*args, **kwargs)

  File "c:\docume~1\dew\locals~1\temp\tmp55u9fk.py", line 9, in __init__

    super(dForm_9332035386, self).__init__(parent=parent,

attProperties=attProperties, 

*args, **kwargs)

  File "C:\projects\dabo\dabo\ui\uiwx\dForm.py", line 870, in __init__

    BaseForm.__init__(self, preClass, parent, properties, attProperties, *args,

**kwargs)
  File "C:\projects\dabo\dabo\ui\uiwx\dForm.py", line 43, in __init__

    fm.dFormMixin.__init__(self, preClass, parent, properties, attProperties,

*args, 
**kwargs)

  File "C:\projects\dabo\dabo\ui\uiwx\dFormMixin.py", line 66, in __init__

    attProperties, *args, **kwargs)

  File "C:\projects\dabo\dabo\ui\uiwx\dPemMixin.py", line 185, in __init__

    self._afterInit()

  File "C:\projects\dabo\dabo\ui\uiwx\dForm.py", line 69, in _afterInit

    super(BaseForm, self)._afterInit()

  File "C:\projects\dabo\dabo\ui\uiwx\dFormMixin.py", line 111, in _afterInit

    self.createBizobjs()
  File "c:\docume~1\dew\locals~1\temp\tmp55u9fk.py", line 417, in createBizobjs

    fotoinfBizobj = FotoinfBizobj(self.Connection)

  File "C:\projects\dabo\dabo\biz\dBizobj.py", line 42, in __init__

    self._afterInit()

  File "C:\projects\dabo\dabo\dObject.py", line 159, in _afterInit

    self.afterInit()
  File "c:\docume~1\dew\locals~1\temp\tmp55u9fk.py", line 394, in afterInit

    except dException.ConnectionLostException, e:

NameError: global name 'dException' is not defined
 


so I added :

                # run the requery
                uiException = None
                cursor = self._CurrentCursor
                try:
                        cursor.requery(params)
                        print "REQUERY", self.DataSource

                except:
                        print "exception raised"

The debug output demonstrates the requery() fails:


Dabo Info Log: Sat Sep 01 19:25:07 2007: 1 database connection definition(s)
 loaded.

Dabo Info Log: Sat Sep 01 19:25:08 2007: User interface set to 'wx' by dApp.

Dabo Info Log: Sat Sep 01 19:25:08 2007: wxPython Version: 2.8.1.1 wxMSW 

(unicode)

 exception raised
Dabo Info Log: Sat Sep 01 19:25:08 2007: WARNING: No BasePrefKey has been set

for this 
application.

Dabo Info Log: Sat Sep 01 19:25:16 2007: Application finished.

Traceback (most recent call last):
  File "C:\projects\dabo\dabo\ui\uiwx\dGrid.py", line 297, in IsEmptyCell

    return not bizobj.getFieldVal(field, row)
  File "C:\projects\dabo\dabo\biz\dBizobj.py", line 1285, in getFieldVal

    return cursor.getFieldVal(fld, row)
  File "C:\projects\dabo\dabo\db\dCursorMixin.py", line 781, in getFieldVal

    raise dException.FieldNotFoundException, "%s '%s' %s" % (

dabo.dException.FieldNotFoundException: Field 'phType' does not exist in the

data set



the Bizobj  code is:

class FotoinfBizobj(dabo.biz.dBizobj):
                def afterInit(self):
                        self.DataSource = "FotoInf"
                        self.KeyField = "count0"
                        self.LinkField = "recordID_fk"
                        testsql = """Select FotoInf.count0, 
FotoInf.recordID_fk, 
                        FotoInf.FInfoID_fk, InfoPT.photoType
                        From FotoInf inner join InfoPT on FotoInf.FInfoID_fk = 
                        InfoPT.InfoID"""
                        self.UserSQL= testsql
                        #self.requery()
                        # run the requery
                        
                        uiException = None
                        cursor = self._CurrentCursor
                        try:
                                        cursor.requery(params)
                                        print "REQUERY", self.DataSource
                        
                        
                        except: 
                                        print " exception raised"
                        
                        
                        
                        
                        
                def validateRecord(self):
                        """Returning anything other than an empty string from
                        this method will prevent the data from being saved.
                        """
                        ret = ""
                        # Add your business rules here. 
                        return ret




                       dwarder



_______________________________________________
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/dabo-users/[EMAIL PROTECTED]

Reply via email to