query = db.GqlQuery('SELECT * FROM Item ORDER BY date DESC')
cursor = self.request.get('cursor')
if cursor:
    query.with_cursor(cursor)
items = query.fetch(30)
cursor = query.cursor()
How to use cursor() for pagination?