django - Accessing model instances associated with a forms.ModelMultipleChoiceField from the templates -


i'd create form allow visitor pick 1 or several instances of model looks this:

class package(models.model):                                                                                                                          name = models.charfield(max_length=255)     image = models.imagefield(upload_to="foo") 

i have created form looks this:

class packageselectionform(forms.form):     packages = forms.modelmultiplechoicefield(queryset=package.objects.all(), widget=forms.checkboxselectmultiple()) 

now, i'd display image associated each package instance in html form in respective label tags (or near), can't manage find way access instances form fields.

do see how can?

thanks


Comments

Popular posts from this blog

many to many - Django Rest Framework ManyToMany filter multiple values -

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

Java Entity Manager - JSON reader was expecting a value but found 'db' -