AttributeError: 'LotInfo1' object has no attribute '_cachedForm'

Traceback (innermost last):

File "d:\pyProject\LotsMfrm1.py", line 1, in <module>
  import dabo
File "d:\pyProject\LotsMfrm1.py", line 452, in <module>
  app.start()
File "d:\dabo\dabo\dApp.py", line 257, in start
  self.setup()
File "d:\dabo\dabo\dApp.py", line 222, in setup
  self.initUIApp()
File "d:\dabo\dabo\dApp.py", line 249, in initUIApp
  self.uiApp.setup()
File "d:\dabo\dabo\ui\uiwx\uiApp.py", line 222, in setup
  frm = self.dApp.MainForm = mfc()
File "d:\dabo\dabo\ui\uiwx\dForm.py", line 826, in __init__
  BaseForm.__init__(self, preClass, parent, properties, attProperties,
*args, **kwargs)
File "d:\dabo\dabo\ui\uiwx\dForm.py", line 42, in __init__
  fm.dFormMixin.__init__(self, preClass, parent, properties, attProperties,
*args, **kwargs)
File "d:\dabo\dabo\ui\uiwx\dFormMixin.py", line 72, in __init__
  attProperties, *args, **kwargs)
File "d:\dabo\dabo\ui\uiwx\dPemMixin.py", line 184, in __init__
  self._afterInit()
File "d:\dabo\dabo\ui\uiwx\dForm.py", line 68, in _afterInit
  super(BaseForm, self)._afterInit()
File "d:\dabo\dabo\ui\uiwx\dFormMixin.py", line 119, in _afterInit
  super(dFormMixin, self)._afterInit()
File "d:\dabo\dabo\ui\uiwx\dPemMixin.py", line 292, in _afterInit
  self.afterInit()
File "d:\pyProject\LotsMfrm1.py", line 322, in afterInit
  self.Sizer.append1x(MainPanel(self))
File "d:\dabo\dabo\ui\uiwx\dPanel.py", line 172, in __init__
  _PanelMixin.__init__(self, preClass, parent, properties, attProperties,
*args, **kwargs)
File "d:\dabo\dabo\ui\uiwx\dPanel.py", line 31, in __init__
  *args, **kwargs)
File "d:\dabo\dabo\ui\uiwx\dPemMixin.py", line 184, in __init__
  self._afterInit()
File "d:\dabo\dabo\ui\uiwx\dPemMixin.py", line 292, in _afterInit
  self.afterInit()
File "d:\pyProject\LotsMfrm1.py", line 439, in afterInit
  hs=MainPanelFrames(self)
File "d:\dabo\dabo\ui\uiwx\dPanel.py", line 157, in __init__
  _PanelMixin.__init__(self, preClass, parent, properties, attProperties,
*args, **kwargs)
File "d:\dabo\dabo\ui\uiwx\dPanel.py", line 31, in __init__
  *args, **kwargs)
File "d:\dabo\dabo\ui\uiwx\dPemMixin.py", line 184, in __init__
  self._afterInit()
File "d:\dabo\dabo\ui\uiwx\dPemMixin.py", line 292, in _afterInit
  self.afterInit()
File "d:\pyProject\LotsMfrm1.py", line 221, in afterInit
  pgf.appendPage(pgCls=InfoPanel, caption="Information")
File "d:\dabo\dabo\ui\uiwx\dPageFrameMixin.py", line 142, in appendPage
  return self.insertPage(self.GetPageCount(), pgCls, caption, imgKey)
File "d:\dabo\dabo\ui\uiwx\dPageFrameMixin.py", line 171, in insertPage
  pg = pgCls(self)
File "d:\dabo\dabo\ui\uiwx\dPanel.py", line 157, in __init__
  _PanelMixin.__init__(self, preClass, parent, properties, attProperties,
*args, **kwargs)
File "d:\dabo\dabo\ui\uiwx\dPanel.py", line 31, in __init__
  *args, **kwargs)
File "d:\dabo\dabo\ui\uiwx\dPemMixin.py", line 184, in __init__
  self._afterInit()
File "d:\dabo\dabo\ui\uiwx\dPemMixin.py", line 292, in _afterInit
  self.afterInit()
File "d:\pyProject\LotsMfrm1.py", line 208, in afterInit
  gs=LotInfo1(self)
File "d:\dabo\dabo\ui\uiwx\dPanel.py", line 157, in __init__
  _PanelMixin.__init__(self, preClass, parent, properties, attProperties,
*args, **kwargs)
File "d:\dabo\dabo\ui\uiwx\dPanel.py", line 31, in __init__
  *args, **kwargs)
File "d:\dabo\dabo\ui\uiwx\dPemMixin.py", line 184, in __init__
  self._afterInit()
File "d:\dabo\dabo\ui\uiwx\dPemMixin.py", line 292, in _afterInit
  self.afterInit()
File "d:\pyProject\LotsMfrm1.py", line 159, in afterInit
  sp=RALookupPanel(self, TargetBizObj=self.Form.PrimaryBizobj,
BizObjField='fk_species', CodeObjRegID='txtSpeciesCodeID',
CodeObjFindBtnRegID='btnSpeciesCodeID', DescObjRegID='txtSpeciesNameID',
DescObjFindBtnRegID='btnSpeciesNameID',
LookupBizObj=self.Form.SpeciesLookup, LookupCodeField='specnum',
LookupDescField='specname')
File "d:\dabo\dabo\ui\dPemMixinBase.py", line 151, in _getForm
  return self._cachedForm


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Ed Leafe
Sent: Saturday, April 07, 2007 7:58 AM
To: Dabo Users list
Subject: Re: [dabo-users] Getting subclass to work with parameters

On Apr 7, 2007, at 12:26 AM, <[EMAIL PROTECTED]>  
<[EMAIL PROTECTED]> wrote:

> I have successfully subclassed the dPanel class previously.  Now I  
> want to
> add some parameters to my subclass, but when I run it I get an  
> error msg
> telling me that _cacheForm is not a property.   How do I call the  
> class with
> my parameters.

        Can you post the traceback? There should be an attribute named  
'_cachedForm' that is common to all UI objects.

> Example:
>
> class RALookupPanel(dabo.ui.dPanel):
>     def _getCodeObjRegID(self):
>         return getattr(self, "_CodeObjRegID", None)
>     def _setCodeObjRegID(self, val):
>         self._CodeObjRegID = val
>     CodeObjRegID = property(_getCodeObjRegID, _setCodeObjRegID)
>
>
> I am trying to call it like this...
>
> lp=RALookupPanel(self, CodeObjRegID = 'somevalue')

        Again, the traceback is essential to find out what isn't working.

> Looking at the dPanel class I see that it has the parameters (self,  
> parent,
> ...., etc)  but don’t know how to deal with the these.

        OK, here's a quick explanation:

class dPanel(_PanelMixin, wx.Panel):
        def __init__(self, parent, properties=None, attProperties=None,  
*args, **kwargs):

        self -> automatically sent by Python to all instances. You never  
send it yourself.
        parent -> Required. Only forms and dialogs can exist without being  
'contained' by another control. The parent parameter is a reference  
to the object that will contain the panel you are creating.
        properties=None -> You can pass properties as a dictionary, with the

prop name as the key, and the initial value as the value. Defaults to  
None; you can therefore safely ignore it if you don't need it.
        attProperties=None -> Just like the properties parameter, except  
that the values are all strings. This is used when retrieving  
properties and their values from an XML file, such as a .cdxml class  
definition. Unless you're writing something that directly interprets  
such files, you can ignore this.
        *args, **kwargs -> Catch-all for any additional arguments and  
keyword arguments, respectively. I don't want to go into a whole  
explanation, as there are many available on the web (try: http:// 
www.network-theory.co.uk/docs/pytut/KeywordArguments.html, or http:// 
tinyurl.com/yprwyu), but this is the magic that allows for the sort  
of flexibility Paul built into Dabo to pass arbitrary properties to  
objects when they are being created.


-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com



_______________________________________________
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/3155D449-96FD-49AA-B91B-2781047B2
[EMAIL PROTECTED]

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.26/750 - Release Date: 06-Apr-2007
9:30 PM
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.26/750 - Release Date: 06-Apr-2007
9:30 PM
 


_______________________________________________
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