示例#1
0
 def groups(self, request, page=1):
     sortable = Sortable(Group.query, 'id', request)
     pagination = URLPagination(sortable.get_sorted(), page)
     return {
         'groups': [group for group in pagination.query if group.parents],
         'pagination': pagination,
         'table': sortable
     }
示例#2
0
 def users(self, request, page=1):
     query = User.query.options(db.joinedload('profile'))
     sortable = Sortable(query, 'id', request)
     pagination = URLPagination(sortable.get_sorted(), page)
     return {
         'users': pagination.query,
         'pagination': pagination,
         'table': sortable
     }