Author: Nataraj S Narayan
Posted: 2006-06-28 07:35:16 Link
Hi
I was trying to get running the dGrid demo. I get the following errors.
Plz help.
regards
Nataraj
ile
"/usr/lib/python2.4/site-packages/Dabo-0.7a-py2.4.egg/dabo/ui/uiwx/dFormMixin.py",
line 93, in _afterInit
super(dFormMixin, self)._afterInit()
File
"/usr/lib/python2.4/site-packages/Dabo-0.7a-py2.4.egg/dabo/ui/uiwx/dPemMixin.py",
line 231, in _afterInit
self.afterInit()
File "", line 74, in afterInit
File "/tmp/tmpQnMwuS.py", line 10, in afterInit_0
biz.KeyField="orderno"
File
"/usr/lib/python2.4/site-packages/Dabo-0.7a-py2.4.egg/dabo/biz/dBizobj.py",
line 141, in __setattr__
super(dBizobj, self).__setattr__(att, val)
File
"/usr/lib/python2.4/site-packages/Dabo-0.7a-py2.4.egg/dabo/biz/dBizobj.py",
line 1435, in _setKeyField
cursor = self._CurrentCursor
File
"/usr/lib/python2.4/site-packages/Dabo-0.7a-py2.4.egg/dabo/biz/dBizobj.py",
line 123, in __getattr__
raise AttributeError, _(" '%s' object has no attribute '%s' ") %
(self.__class__.__name__, att)
AttributeError: 'dBizobj' object has no attribute '_CurrentCursor'
Author: Echo
Posted: 2006-06-29 01:05:21 Link
On 6/28/06, Nataraj S Narayan <natarajsn@sancharnet.in> wrote:
> Hi
>
> I was trying to get running the dGrid demo. I get the following errors.
I can't seem to find the dGrid demo. What is the file name for it?
Also, does it happen when you first run it or when you do something
after it is running?
--
"Now that I am a Christian I do not have moods in which the whole
thing looks very improbable: but when I was an atheist I had moods in
which Christianity looked terribly probable."
-C. S. Lewis
-Echo
Author: Ed Leafe
Posted: 2006-06-29 07:17:37 Link
On Jun 29, 2006, at 12:05 AM, Echo wrote:
> I can't seem to find the dGrid demo. What is the file name for it?
It is the dGrid.py file itself, in the dabo/ui/uiwx directory. All
our base classes have built-in demos; some are more elaborate than
others.
-- Ed Leafe
Author: jbarry
Posted: 2006-07-24 01:42:23 Link
Hey Nataraj,
I wonder if you have sorted this error out? I'm having the same error now.
thanks
jBarry
On 6/28/06, Nataraj S Narayan <natarajsn@sancharnet.in> wrote:
> Hi
>
> I was trying to get running the dGrid demo. I get the following errors.
>
> Plz help.
>
> regards
>
> Nataraj
>
> ile
> "/usr/lib/python2.4/site-packages/Dabo-0.7a-py2.4.egg/dabo/ui/uiwx/dFormMixin.py",
> line 93, in _afterInit
> super(dFormMixin, self)._afterInit()
> File
> "/usr/lib/python2.4/site-packages/Dabo-0.7a-py2.4.egg/dabo/ui/uiwx/dPemMixin.py",
> line 231, in _afterInit
> self.afterInit()
> File "", line 74, in afterInit
> File "/tmp/tmpQnMwuS.py", line 10, in afterInit_0
> biz.KeyField="orderno"
> File
> "/usr/lib/python2.4/site-packages/Dabo-0.7a-py2.4.egg/dabo/biz/dBizobj.py",
> line 141, in __setattr__
> super(dBizobj, self).__setattr__(att, val)
> File
> "/usr/lib/python2.4/site-packages/Dabo-0.7a-py2.4.egg/dabo/biz/dBizobj.py",
> line 1435, in _setKeyField
> cursor = self._CurrentCursor
> File
> "/usr/lib/python2.4/site-packages/Dabo-0.7a-py2.4.egg/dabo/biz/dBizobj.py",
> line 123, in __getattr__
> raise AttributeError, _(" '%s' object has no attribute '%s' ") %
> (self.__class__.__name__, att)
> AttributeError: 'dBizobj' object has no attribute '_CurrentCursor'
>
>
>
Author: Richard Esplin
Posted: 2008-10-03 00:32:31 Link
I've been having a problem since I updated from SVN this evening. Once I load
my form into ClassDesigner and make a change, I can no longer run my
application, save my form, or close cleanly the ClassDesigner.
I can duplicate the problem with a clean form as soon as I add a DataGrid to
the horizontal sizer. Removing the DataGrid makes the problem go away. The
GridList appears to work fine.
Google says that someone posted the same error to the mailing list in 2006,
but I couldn't find a response.
Here is the last few lines of my traceback:
line 253, in getDesignerDict
ret["children"] = self.getChildrenPropDict(classDict)
File "/usr/local/share/applications/dabo/ide/ClassDesignerComponents.py",
line 411, in getChildrenPropDict
classDict=kidDict))
File "/usr/local/share/applications/dabo/ide/ClassDesignerComponents.py",
line 145, in getDesignerDict
csz = self.ControllingSizer
AttributeError: 'controlMix' object has no attribute 'ControllingSizer'
My form is pretty simple:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<dForm code-ID="dForm-top" CxnFile="path://../db/defaultdb.cnxml" Name="dForm"
Caption="Sampling Application" Top="0" Height="676" Width="1353"
designerClass="DesForm" CxnName="DefaultDB" UseSizers="True" Left="59">
<dSizer SlotCount="1" designerClass="LayoutSizer" Orientation="Vertical">
<dPanel sizerInfo="{'Proportion':
1, 'HAlign': 'Center', 'VAlign': 'Middle', 'Expand': True}"
designerClass="controlMix">
<dSizer SlotCount="2" designerClass="LayoutSizer"
Orientation="Horizontal">
<dGrid ColumnCount="4" code-ID="dGrid-dPanel"
sizerInfo="{'Proportion': 1, 'Expand': True}" Name="GridListRecords"
Editable="False" designerClass="controlMix" DataSource="table1"
SelectionMode="Row">
<dColumn Caption="id" DataField="id" designerClass="controlMix"
Order="0" Width="64"></dColumn>
<snip>
<dColumn Caption="Column4" DataField="col4"
designerClass="controlMix" Order="30" Width="157"></dColumn>
</dGrid>
<dGridSizer HGap="5" sizerInfo="{'Proportion': 1, 'Border':
10, 'Expand': True}" Rows="12" designerClass="LayoutGridSizer" VGap="5"
MaxDimension="r" Columns="2">
<dLabel Width="12" sizerInfo="{'Proportion': 0, 'ColExpand':
False, 'VAlign': 'Middle', 'Expand': False, 'RowExpand': False}"
designerClass="controlMix" rowColPos="(0, 0)" Caption="id"></dLabel>
<dTextBox sizerInfo="{'Proportion': 0, 'ColExpand':
True, 'VAlign': 'Middle', 'Expand': True, 'RowExpand': False}" rowColPos='(0,
1)' designerClass='controlMix' DataSource='table1' DataField='id'></
dTextBox>
<snip>
</dGridSizer> </dSizer> </dPanel> </dSizer> </dForm>
How best can I determine if the problem is on my side, or if a fix is
necessary in the framework?
Thank you,
Richard
Author: Ed Leafe
Posted: 2008-10-03 07:51:52 Link
On Oct 2, 2008, at 11:32 PM, Richard Esplin wrote:
> I can duplicate the problem with a clean form as soon as I add a
> DataGrid to
> the horizontal sizer. Removing the DataGrid makes the problem go
> away. The
> GridList appears to work fine.
Thanks for mentioning that the grid caused the problem to appear. I
tracked down the error and posted a fix.
> Google says that someone posted the same error to the mailing list
> in 2006,
> but I couldn't find a response.
That's funny, since it was a direct result of the change I made last
night!
-- Ed Leafe
Dabo folks:
I'm working on the HoursForm part of the "Step by Step" application tutorial. I've put together the data entry fields, and have entered in the biz obj code and the code in the afterInit method on the form. I'm getting the error <<AttributeError: 'NoneType' object has no attribute 'getBizobj'>>
I don't fully understand (on my third day with Dabo) what's going on with the bizobj stuff.
->I'm using the standard directory structure (created by quickstart)
->I've got "HoursBizobj.py" located in the biz directory
->the HoursBizobj has the code suggested in tutorial:?
??? def getClients(self):
??????? """Return a 2-tuple of lists of the client names and their keys."""
??????? crs = self.getTempCursor()
??????? crs.execute("select pkid, clientname from clients order by clientname")
??????? ds = crs.getDataSet()
??????? # Create the lists
??????? names = [rec["clientname"] for rec in ds]
??????? keys = [rec["pkid"] for rec in ds]
??????? # Add the entry for an undefined (new) client
??????? names.insert(0, "-Please Select a Client-")
??????? keys.insert(0, 0)
??????? return (names, keys)
??? def validateRecord(self):
??????? ret = ""
??????? # Make sure that the user selected a valid client
??????? if self.Record.clientfk == 0:
??????????? ret = "You must select a valid client"
??????? return ret
-> the afterInit method has the code suggested in the tutorial:
def afterInit(self):
??biz = self.Form.getBizobj("hours")???
??names, pks = biz.getClients()???
??self.Choices = names???
??self.Keys = pks???
??self.ValueMode = "Key"
??? I don't understand why we pass "hours" to the getBizobj function -- the the bizobj file located in the biz directory is called HoursBizobj.py. I get same error when I change "hours" to "HoursBizobj" though. How can self.Form.getBizobj find the HoursBizobj.py code based on the parameter "hours" ???
Thanks for your help, and here's the full "trace back"
C:\Documents and Settings\Jonathan Poor\DABO\ClientHours>python main.py
Traceback (most recent call last):
? File "main.py", line 13, in <module>
??? app.start()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\dApp.py", line 3
72, in start
??? self.setup()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\dApp.py", line 3
28, in setup
??? self.initUIApp()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\dApp.py", line 3
64, in initUIApp
??? self.uiApp.setup()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\uiApp.py
", line 412, in setup
??? frm = self.dApp.MainForm = dabo.ui.createForm(mfc)
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\__init__
.py", line 1145, in createForm
??? frm = cls(*args, **kwargs)
? File "c:\docume~1\jonath~1\locals~1\temp\tmpf23nhk.py", line 9, in __init__
??? super(dForm_95973, self).__init__(parent=parent, attProperties=attProperties
, *args, **kwargs)
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dForm.py
", line 931, in __init__
??? BaseForm.__init__(self, preClass, parent, properties, attProperties, *args,
**kwargs)
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dForm.py
", line 44, in __init__
??? fm.dFormMixin.__init__(self, preClass, parent, properties, attProperties, *a
rgs, **kwargs)
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dFormMix
in.py", line 89, in __init__
??? attProperties, *args, **kwargs)
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dPemMixi
n.py", line 186, in __init__
??? self._afterInit()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dForm.py
", line 71, in _afterInit
??? super(BaseForm, self)._afterInit()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dFormMix
in.py", line 143, in _afterInit
??? super(dFormMixin, self)._afterInit()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dPemMixi
n.py", line 320, in _afterInit
??? self.afterInit()
? File "c:\docume~1\jonath~1\locals~1\temp\tmpf23nhk.py", line 248, in afterInit
??? biz = self.Form.getBizobj("hours")
AttributeError: 'NoneType' object has no attribute 'getBizobj'
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
BTW, I'm not sure where those question marks are coming from. I checked my files, and those are chr(20) (spaces). (I'm running in Windows).
Jonathan
-----Original Message-----
From: jpoorrandp@aol.com
To: Dabo-users@leafe.com
Sent: Fri, Jul 24, 2009 1:48 pm
Subject: [dabo-users] AttributeError
Dabo folks:
I'm working on the HoursForm part of the "Step by Step" application tutorial.
I've put together the data entry fields, and have entered in the biz obj code
and the code in the afterInit method on the form. I'm getting the error
<<AttributeError: 'NoneType' object has no attribute 'getBizobj'>>
I don't fully understand (on my third day with Dabo) what's going on with the
bizobj stuff.
->I'm using the standard directory structure (created by quickstart)
->I've got "HoursBizobj.py" located in the biz directory
->the HoursBizobj has the code suggested in tutorial:?
??? def getClients(self):
??????? """Return a 2-tuple of lists of the client names and their keys."""
??????? crs = self.getTempCursor()
??????? crs.execute("select pkid, clientname from clients order by clientname")
??????? ds = crs.getDataSet()
??????? # Create the lists
??????? names = [rec["clientname"] for rec in ds]
??????? keys = [rec["pkid"] for rec in ds]
??????? # Add the entry for an undefined (new) client
??????? names.insert(0, "-Please Select a Client-")
??????? keys.insert(0, 0)
??????? return (names, keys)
??? def validateRecord(self):
??????? ret = ""
??????? # Make sure that the user selected a valid client
??????? if self.Record.clientfk == 0:
??????????? ret = "You must select a valid client"
??????? return ret
-> the afterInit method has the code suggested in the tutorial:
def afterInit(self):
??biz = self.Form.getBizobj("hours")???
??names, pks = biz.getClients()???
??self.Choices = names???
??self.Keys = pks???
??self.ValueMode = "Key"
??? I don't understand why we pass "hours" to the getBizobj function -- the the
bizobj file located in the biz directory is called HoursBizobj.py. I get same
error when I change "hours" to "HoursBizobj" though. How can self.Form.getBizobj
find the HoursBizobj.py code based on the parameter "hours" ???
Thanks for your help, and here's the full "trace back"
C:\Documents and Settings\Jonathan Poor\DABO\ClientHours>python main.py
Traceback (most recent call last):
? Fil
e "main.py", line 13, in <module>
??? app.start()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\dApp.py", line 3
72, in start
??? self.setup()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\dApp.py", line 3
28, in setup
??? self.initUIApp()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\dApp.py", line 3
64, in initUIApp
??? self.uiApp.setup()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\uiApp.py
", line 412, in setup
??? frm = self.dApp.MainForm = dabo.ui.createForm(mfc)
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\__init__
.py", line 1145, in createForm
??? frm = cls(*args, **kwargs)
? File "c:\docume~1\jonath~1\locals~1\temp\tmpf23nhk.py", line 9, in __init__
??? super(dForm_95973, self).__init__(parent=parent, attProperties=attProperties
, *args, **kwargs)
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dForm.py
", line 931, in __init__
??? BaseForm.__init__(self, preClass, parent, properties, attProperties, *args,
**kwargs)
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dForm.py
", line 44, in __init__
??? fm.dFormMixin.__init__(self, preClass, parent, properties, attProperties, *a
rgs, **kwargs)
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dFormMix
in.py", line 89, in __init__
??? attProperties, *args, **kwargs)
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dPemMixi
n.py", line 186, in __init__
??? self._afterInit()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dForm.py
", line 71, in _afterInit
??? super(BaseForm, self)._afterInit()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dFormMix
in.py", line 143, in _afterInit
??? super(dFormMixin, self)._afterInit()
? File "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\uiwx\dPemMixi
n.py", line 320, in _afterInit
??? self.afterInit()
? File "c:\docume~1\jonath~1\locals~1\temp\tmpf23nhk.py", line
248, in afterInit
??? biz = self.Form.getBizobj("hours")
AttributeError: 'NoneType' object has no attribute 'getBizobj'
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
[excessive quoting removed by server]
On Jul 24, 2009, at 12:48 PM, jpoorrandp@aol.com wrote:
> ??? I don't understand why we pass "hours" to the getBizobj function
> -- the the bizobj file located in the biz directory is called
> HoursBizobj.py. I get same error when I change "hours" to
> "HoursBizobj" though. How can self.Form.getBizobj find the
> HoursBizobj.py code based on the parameter "hours" ???
Because it is searching for objects that the form already knows
about; it's not trying to import them from any file. Earlier in the
process you added an instance of the HoursBizobj to the form; the form
stores references to its bizobjs using the bizobj DataSource as the
key; in this case, the DataSource is 'hours'.
> ??? biz = self.Form.getBizobj("hours")
> AttributeError: 'NoneType' object has no attribute 'getBizobj'
That's an odd error: it says that the dropdown cannot resolve the
'Form' property. Are you sure that this code is in the dropdown's
afterInit(), and not in the form's afterInit()?
-- Ed Leafe
In a message dated 7/26/2009 6:35:18 P.M. Eastern Daylight Time,
ed@leafe.com writes:
On Jul 24, 2009, at 12:48 PM, jpoorrandp@aol.com wrote:
> ??? I don't understand why we pass "hours" to the getBizobj function
> -- the the bizobj file located in the biz directory is called
> HoursBizobj.py. I get same error when I change "hours" to
> "HoursBizobj" though. How can self.Form.getBizobj find the
> HoursBizobj.py code based on the parameter "hours" ???
Because it is searching for objects that the form already knows
about; it's not trying to import them from any file. Earlier in the
process you added an instance of the HoursBizobj to the form; the form
stores references to its bizobjs using the bizobj DataSource as the
key; in this case, the DataSource is 'hours'.
Aha!
> ??? biz = self.Form.getBizobj("hours")
> AttributeError: 'NoneType' object has no attribute 'getBizobj'
That's an odd error: it says that the dropdown cannot resolve the
'Form' property. Are you sure that this code is in the dropdown's
afterInit(), and not in the form's afterInit()?
That's it! I had it in the form's method.
Works now. On to the next bit.
Thanks Ed.
Jonathan
**************An Excellent Credit Score is 750. See Yours in Just 2 Easy
Steps!
yExcfooterNO62)
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---