I've got an appwizard app where I want to turn one of the PagEdit form
fields to a dropdownlist.
I've followed the little tutorial here:
http://wiki.dabodev.com/HowToPopulateAndUseListControls
and here:
http://leafe.com/archives/msg/342481
so that my Records.py biz object file contains this:
def getTasks(self):
"""Return a 2-tuple of lists of the types and their keys."""
crs = self.getTempCursor()
crs.execute("select id, name from tasks order by name")
ds = crs.getDataSet()
# Create the lists
names = [rec["name"] for rec in ds]
keys = [rec["id"] for rec in ds]
return (names, keys)
and my ui\PagEditRecord.py file has this:
mybiz = self.getBizObject("records")
names, keys = mybiz.getTasks()
objectRef = self.addObject(dabo.ui.dDropdownList, NameBase="taskID",
DataSource="tasks", DataField="id", ValueMode="Key",
Choices, Keys = mybiz.getTasks())
Running the app fails with this traceback:
C:\normacapps\timeReporting>python timeReporting.py
Traceback (most recent call last):
File "timeReporting.py", line 19, in <module>
import ui
File "C:\normacapps\timeReporting\ui\__init__.py", line 11, in <module>
from FrmRecords import FrmRecords
File "C:\normacapps\timeReporting\ui\FrmRecords.py", line 10, in <module>
from PagEditRecords import PagEditRecords
File "C:\normacapps\timeReporting\ui\PagEditRecords.py", line 73
DataSource="tasks", DataField="id", ValueMode="Key", Choices, Keys =
mybiz.getTasks())
SyntaxError: non-keyword arg after keyword arg
I followed this exactly from the wiki. What am I doing wrong?
Carey
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
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]