def paginate(self, q):
self.record_count = q.count()<EOL>return self.apply_pagination(q).all()<EOL>
Filters the query so that a given page is returned. The record count
is computed automatically from query.
:param q: Query to be paged.
:return: Paged query.