I'm getting this error when I'm rendering the below from as (form.as_ul)
class InputParametersForm(ModelForm):
sqlConnection = SQLSeverConnection('MSSQLServerDataSource')
tableChoices = {'id': 'value'}
sqlQuery = sqlConnection.getTableNames()
for id in sqlQuery:
tableChoices['id'] = id
for value in sqlQuery:
tableChoices['value'] = value
TableName = forms.ChoiceField(widget=forms.Select(tableChoices),
choices=tableChoices)
ColumnName = forms.ChoiceField(widget=forms.Select())
StartDateTime = forms.DateField(widget=SelectDateWidget())
EndDateTime = forms.DateField(widget=SelectDateWidget())
class Meta:
model = SelectionHistory
fields = ("TableName", "ColumnName", "StartDateTime", "EndDateTime")
This breaking onyl occurs when I ass the choices to my TableName widget, am I supplying the choices wrongly?
I'm using a dictionary of two columns (both of the same type to populate the html select box) but previously supplied only the list of table names and recieved the error Exception Type: ValueError Exception Value: need more than 1 value to unpack