You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building on #320 and #332, once a TransitAgency has multiple EligibilityVerifier references, the user needs a way to select which one they will use for verification.
Django has the ChoiceField which can use the widget=RadioSelect to render as a list of radio buttons. The field takes a list of choices, each a tuple where the first item is the value and the second is the label:
from django import forms
choices = [("value1", "Label One"), ("value2", "Label Two")]
field = forms.ChoiceField(choices=choices, widget=forms.RadioSelect)
for GET: If agency has multiple verifiers, initialize form with the selected agency's verifiers and send to the template; otherwise store the one verifier in session and immediately redirect to eligibility:start
for POST: store the selected verifier in session and redirect to eligibility:start
The text was updated successfully, but these errors were encountered:
Background
Building on #320 and #332, once a
TransitAgency
has multipleEligibilityVerifier
references, the user needs a way to select which one they will use for verification.Django has the
ChoiceField
which can use thewidget=RadioSelect
to render as a list of radio buttons. The field takes a list ofchoices
, each a tuple where the first item is the value and the second is the label:See e.g. https://stackoverflow.com/a/5925240/453168
Tasks
EligibilityVerifierSelectionForm
inbenefits/eligibility/forms.py
; form shouldPOST
toeligibility:index
ChoiceField
usingwidget=RadioSelect
__init__()
method accepting anagency
parameterChoiceField.choices
from theagency.eligibility_verifiers
property, using the abovechoices
structure as an exampleeligibility:index
view to handle bothGET
andPOST
GET
: If agency has multiple verifiers, initialize form with the selected agency's verifiers and send to the template; otherwise store the one verifier in session and immediately redirect toeligibility:start
POST
: store the selected verifier in session and redirect toeligibility:start
The text was updated successfully, but these errors were encountered: