from django import forms
from django.utils.translation import gettext_lazy as _

FORM_CHOICES = (("all", _("All fields")), ("title", _("Title")), ("upc", _("UPC")))


class ProductSearchForm(forms.Form):
    q = forms.CharField(max_length=255, required=False, label=_("Search"))
    context = forms.ChoiceField(
        choices=FORM_CHOICES, initial="all", widget=forms.RadioSelect
    )
    field_order = ["q", "upc", "title"]
