Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def search_state(cls, name, clause):
- result = super(PurchaseRequest, cls).search_state(name, clause)
- # result contains [('id', 'in', state_query)]
- _, _, state_query = result[0]
- # state query is a python-sql which can be manipullated
- state_query.where &= new_condition # To add new where
- # If required you can join to new tables
- new_query = state_query.join()
- # Or enterly replace the wer
- new_query.where = new_where
- # Once you have customized the query you can return it
- return [('id', 'in', new_query)]
- ~
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement