Hi,

I am making a form that allows for the user filling it out to select
multiple coupons from a list of 20. This form will simply send an
email to me with the selected coupons. So my model looks like this:

class Flyer(models.Model):
    coupons = models.ManyToManyField(Coupon)

I have my form setup as follows:

class OrderForm(forms.Form):
    def get_coupons(request, flyer_id):
        f = Flyer.objects.get(id=flyer_id)
        return f.coupons.all()

    coupon = forms.ChoiceField(choices=get_coupons,
widget=forms.CheckboxSelectMultiple)


I just have not figured out the correct way to pass along the coupons
that are a part of the Flyer model. Can anyone give me a hint on how
to go about this properly?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to