Ed Leafe wrote:
> On Jul 5, 2008, at 11:01 PM, Paul McNary wrote:
>
>> Now it gives me:
>>
>> ./main.py
>> Traceback (most recent call last):
>> File "./main.py", line 9, in ?
>> import biz
>> File "/u/z/sco_maint/dabo/tutorial/hours/biz/__init__.py", line 15,
>> in ?
>> from BizClient import BizClient
>> File "/u/z/sco_maint/dabo/tutorial/hours/biz/BizClient.py", line 1,
>> in ?
>> class BizClient(dabo.biz.dBizobj):
>> NameError: name 'dabo' is not defined
>>
>> but dabo was imported in main.py.
>
>
> Hey, good catch. I've been coding Python for so long that I just
> assumed that everyone would know to add the import to the bizobj code.
> I've updated the step-by-step doc to include the header and the
> 'import dabo' statement.
>
> Each script has its own namespace, so importing something in one
> script doesn't affect any other script; if you reference a module in
> any script, you must import it in that script. So at the top of your
> bizobj scripts, add this:
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> import dabo
>
> Let me know if that fixes the problem.
>
> -- Ed Leafe
>
>
Hello Ed
That worked, Now I'm down to the populate a combo-box or drop-down with
data. I've read through the wiki entry and the mailing list entry noted
in the wiki. however I am getting the following.
Traceback (most recent call last):
File "./main.py", line 23, in ?
app.start()
File
"/usr/lib/python2.4/site-packages/Dabo-0.8.4-py2.4.egg/dabo/dApp.py",
line 312, in start
self.setup()
File
"/usr/lib/python2.4/site-packages/Dabo-0.8.4-py2.4.egg/dabo/dApp.py",
line 277, in setup
self.initUIApp()
File
"/usr/lib/python2.4/site-packages/Dabo-0.8.4-py2.4.egg/dabo/dApp.py",
line 304, in initUIApp
self.uiApp.setup()
File
"/usr/lib/python2.4/site-packages/Dabo-0.8.4-py2.4.egg/dabo/ui/uiwx/uiApp.py",
line 277, in setup
frm = self.dApp.MainForm = dabo.ui.createForm(mfc)
File
"/usr/lib/python2.4/site-packages/Dabo-0.8.4-py2.4.egg/dabo/ui/uiwx/__init__.py",
line 1074, in createForm
frm = cls(*args, **kwargs)
File "/tmp/tmpCa8oJa.py", line 74, in __init__
obj = self.getCustControlClass('dComboBox_91458075183')(currParent)
File "/tmp/tmpCa8oJa.py", line 149, in __init__
dabo.ui.dComboBox.__init__(self, parent=parent,
attProperties=attProperties, *args, **kwargs)
File
"/usr/lib/python2.4/site-packages/Dabo-0.8.4-py2.4.egg/dabo/ui/uiwx/dComboBox.py",
line 26, in __init__
dcm.dControlItemMixin.__init__(self, preClass, parent, properties,
attProperties, *args, **kwargs)
File
"/usr/lib/python2.4/site-packages/Dabo-0.8.4-py2.4.egg/dabo/ui/uiwx/dControlItemMixin.py",
line 20, in __init__
super(dControlItemMixin, self).__init__(*args, **kwargs)
File
"/usr/lib/python2.4/site-packages/Dabo-0.8.4-py2.4.egg/dabo/ui/dDataControlMixinBase.py",
line 22, in __init__
dabo.ui.dControlMixin.__init__(self, *args, **kwargs)
File
"/usr/lib/python2.4/site-packages/Dabo-0.8.4-py2.4.egg/dabo/ui/uiwx/dPemMixin.py",
line 179, in __init__
self._afterInit()
File
"/usr/lib/python2.4/site-packages/Dabo-0.8.4-py2.4.egg/dabo/ui/uiwx/dPemMixin.py",
line 312, in _afterInit
self.afterInit()
File "/tmp/tmpCa8oJa.py", line 154, in afterInit
names, pks = biz.getClients()
AttributeError: 'NoneType' object has no attribute 'getClients'
The getClients routine is in ./biz/BizHours.py
The afterInit that is calling it is in the ComboBox(Dropdown) Code
located in ./ui/HoursForm-code.py as follows:
# -*- coding: utf-8 -*-
### Dabo Class Designer code. You many freely edit the code,
### but do not change the comments containing:
### 'Dabo Code ID: XXXX',
### as these are needed to link the code to the objects.
## *!* ## Dabo Code ID: dComboBox-dPanel
def afterInit(self):
biz = self.Form.getBizobj("BizHours")
names, pks = biz.getClients()
self.Choices = names
self.Keys = pks
self.ValueMode = "Key"
## *!* ## Dabo Code ID: dForm-top
def createBizobjs(self):
conn = self.Application.getConnectionByName("Medispan")
bizHours = self.Application.biz.BizHours(conn)
self.addBizobj(bizHours)
Also I started this tutorial of by first placing a Panel on the
Designer. Isn't that what you said needed to be done in all projects?
Thanks again for your time and patience
Paul McNary
[EMAIL PROTECTED]
_______________________________________________
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]