Hello,

I have two models:

     class Currency(models.Model):
        ...
        available = models.BooleanField()

     class Offer(models.Model):
        ...
        currency = models.ForeignKey('Currency')

I make a form from the Offer model:

     class OfferForm(ModelForm):
        class Meta:
           model = Offer

How can I add an attribute tag with the value `currency.available` to
each `<option>` from the `<select>` `Currency` widget?

(I am also open to solutions using external apps (like
django-crispy-forms))

(This question has also been asked on stackoverflow:
http://stackoverflow.com/q/27474719/1011154 )

Best regards
Jonathan Dan

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/548F19D8.7010101%40student.tudelft.nl.
For more options, visit https://groups.google.com/d/optout.

Reply via email to