How do I return only dintinct/unique values in my QuerySelectField?
def getRequestor(): u = Request.query.all() return u class filterRequests(Form): requestor = QuerySelectField(u'Requestor', query_factory=getRequestor, get_label=lambda x: x.requestedBy,get_pk=lambda x: x.requestedBy)
I tried to mess with get_pk, but it doesn't seem to help.
- How do i make the wtf form field default to a value "all" that is not a value in the column.
Thank you
I'm not satisfied with my answer, but using selectfield instead and doin this works:
in the view:
in the form: