> I think if it were me I'd build a form builder function, metaclass, or
> do it in __init__. Probably the easiest is passing in an argument to
> __init__ , that gives enough information to build the form.
That sounds like the kind of thing I'm looking for.
Thanks very much once again,
Chris
If any two inputs have the same name, both values are returned in a
list ala [request.POST.getlist('score')] With the checkboxes it's easy
to identify by value. I assume you might be able to figure out where
that score belongs by order, but I'm not sure order is guaranteed.
I think if it were me
After a few false starts, I managed to get this going.
Now my problem is that this approach only really works for Booleans.
What if I wanted a form to enter test scores for a class, one score per
student ?
All my approaches so far have ended up with multiple fields with the same
name, which then d
> For the attendance form, you might use a MultipleChoiceField
> checkboxSelectMultiple widget, where the value of each choice is set
> to the pk of the student model. You should get a list of id's that
> were checked when the form gets submitted.
Thank you very much. Sounds like that approach
Don't try too hard to directly link form to model.
For the attendance form, you might use a MultipleChoiceField
checkboxSelectMultiple widget, where the value of each choice is set
to the pk of the student model. You should get a list of id's that
were checked when the form gets submitted.
Som
5 matches
Mail list logo