I have a form like so:
class ThingSelectionForm(forms.Form):
things = forms.ModelChoiceField(
queryset=Product.objects.filter(product=my_product),
widget=forms.RadioSelect,
empty_label=None,
)
My question is - how do I pass in the my_product
variable when a page loads? Should I create a custom __init__
method?
Any help much appreciated.