Okay, I want to make the second field of a SQLFORM.factory depend on what is chosen in the first field... something like this...
form = SQLFORM.factory(
Field('PN', requires=IS_NOT_EMPTY()),
Field('Segment', requires=IS_IN_SET(['Segment1', 'Segment2'])),
Field('Family', requires=IS_IN_SET(getFamilies(form.vars.Segment))))
...
Of course I can't use form.vars.Segment until the form is submitted, so how can I accomplish this?
So that the field 'Family' takes the value of the field 'Segment', does a calculation and returns the appropriate list of families.
I'm super new to web programming, so I apologize in advance if this is a dumb question.