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

cron - how to properly run Python script with crontab on every system startup -

elasticsearch - Is the order of operations guaranteed in a bulk update? -

Slow performance first queries on SQL Azure -