Skip to content

Instantly share code, notes, and snippets.

@doobeh
Created December 11, 2013 18:38
Show Gist options
  • Save doobeh/7915977 to your computer and use it in GitHub Desktop.
Save doobeh/7915977 to your computer and use it in GitHub Desktop.
QuerySelectField
def current_departments():
return Department.query
class TransferForm(Form):
sender = SelectField('From', choices=[('001', 'IGA'), ('003', 'Gourmet'), ('002', 'Wholesale')])
receiver = SelectField('To', choices=[('001', 'IGA'), ('003', 'Gourmet'), ('002', 'Wholesale')])
department = QuerySelectField('Department', query_factory=current_departments)
amount = TextField('Amount')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment