I can be used with:
#####
owner = SingleSelectField(label = ownerLabel,
options = getOptions(ownerLabel, Owner)
default = 1)
#####
In this way the select field starts with an entry that tells to select
a value. And after that it has on ordered list off all the values of
the foreign key.
I hope it is usefull for someone.
--
Cecil Westerhof
A sligthy better version:
#####
def cmpOptions(a, b):
temp1 = a[1].lower()
temp2 = b[1].lower()
if temp1 < temp2:
return -1
if temp1 > temp2:
return 1
return 0
def getOptions(label, table):
options = [(entry.id, str(entry)) for entry in table.select()]
options.sort(cmpOptions)
return [(-1, 'Selecteer %s' % (label))] + options
#####
Now dummy comes before Test.
--
Cecil Westerhof