Commit 98c822b2 authored by Paul Brown's avatar Paul Brown

Add documentation for "persistent filter" to get_query

This documents the tip in this issue (for only SQLA): https://github.com/mrjoes/flask-admin/issues/169
parent 3a4a02fa
......@@ -703,6 +703,14 @@ class ModelView(BaseModelView):
Return a query for the model type.
If you override this method, don't forget to override `get_count_query` as well.
This method can be used to set a "persistent filter" on an index_view.
Example::
class MyView(ModelView):
def get_query(self):
return super(MyView, self).get_query().filter(User.username == current_user.username)
"""
return self.session.query(self.model)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment