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

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

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -