Hi
The for tag iterates over the elements of the list you are using so
your code should be
$(function() {
var data = [];
var i = something();
{% for x in content %}
data[i] =
{
roll_no: {{x.roll_no}},
hi there hank23
to fix the problem you just need to send the queryset parameter to the
constructor of the ModelChoiceField
pollquestions = forms.ModelChoiceField(queryset=SomeModel, ...other
stuff...) works but
pollquestions = forms.ModelChoiceField(...other stuff without
queryset...) raises the
2 matches
Mail list logo