SingleSelectField from a list in a dictionary

1 view
Skip to first unread message

casibbald

unread,
Jan 4, 2010, 10:52:35 AM1/4/10
to TurboGears
Hi All,

I have the following bit of code that produces a result from the
command line, but does not work when in Turbogears.

========
for each in deployDict:
print
DeployOptions = list(enumerate((deployDict[each])))
print each.ljust(10),":", DeployOptions
========
output:
========
app : [(0, '2.1.0Beta25'), (1, '2.1.0Beta26'), (2, '2.1.0Beta27'),
(3, '2.1.0Beta28'), (4, '2.1.0Beta29'), (5, '2.1.0Beta30'), (6,
'2.1.0Beta31')]

The enumeration function seems to work correctly, based on the command
line output
================================================================================================================

===============
Form code:
===============

class applicationDeployForm(TableForm):

class fields(WidgetsList):
versionDict = compileVersions()
hover_help = True
DeployOptions = list(enumerate((versionDict["app1_Beta"])))
Deploy = SingleSelectField('Application',
options=DeployOptions, help_text = 'Please select Beta.')
submit_text = 'deploy'

create_applicationDeployForm = applicationDeployForm
("create_applicationDeployForm", action='deployForm')

==============

But when i take a look at it from the form, i get:

⇝ TypeError: 'str' object is not callable

Module ?:19 in <Expression u'tmpl_context.form()'> view
>> <div py:replace="tmpl_context.form()">Input Form</div>
TypeError: 'str' object is not callable

==============

Any ideas

===============

Reply all
Reply to author
Forward
0 new messages