def apply_pagination(self, q):
<EOL>assert self.record_count >= <NUM_LIT:0>, "<STR_LIT>"<EOL>return q.limit(self.page_size).offset(self.offset)<EOL>
Filters the query so that a given page is returned. The record count
must be set in advance.
:param q: Query to be paged.
:return: Paged query.