Answer the question
In order to leave comments, you need to log in
How to make a table with checkboxes and additional information in a form?
There is a ModelForm, in which one of the ModelMultipleChoiceField fields with a CheckboxSelectMultiple widget.
Is it possible to somehow display this field as a table, in the additional columns of which would be the data of the queryset objects of the field?
For example:
class Listener(models.Model):
created = models.DateTimeField(default=timezone.now)
...
class CreateExtGroupFrom(forms.ModelForm):
listeners = forms.ModelMultipleChoiceField(
queryset=ext_models.ExtListener.objects.filter(...),
widget=forms.CheckboxSelectMultiple(),
)
| | Listener | created |
-----------------------------
| [] | listener1 | 1.1.2017 |
| [] | listener2 | 2.1.2017 |
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question