Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9125489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:48:57+00:00 2026-06-17T06:48:57+00:00

I’m developing and application that requires to paginate a list of links. I’m using

  • 0

I’m developing and application that requires to paginate a list of links. I’m using django non-rel with djangoappengine.

I’m aware of the functions set_cursor and get_cursor found in djangoappengine.db.utils which make it easy to navigate forward as such:

paginate_by = 25
queryset = Link.objects.all()

cursor = request.GET.get('cursor') #Alternatively passed via ajax in a POST request
if cursor:
    queryset = set_cursor(queryset, cursor)

links = queryset[0:paginate_by]
next_cursor = get_cursor(links)

However, I’m struggling to navigate backwards. The official procedure in GAE is to reverse the cursor and to use a reversed query. This makes use of a reversed() function that is part of the Cursor class, which I’m unsure I can access in Django.

But how do I reverse a cursor in djangoappengie?

In case it is not possible I believe that the alternative is to store the cursors client side, pass them via ajax, and then generate a query based on page number. I would prefer to follow the official procedures as much as possible, though.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:48:58+00:00Added an answer on June 17, 2026 at 6:48 am

    I don’t know what the policy on answering your own question is…
    After further research I found a function that reverses a cursor, namely:

    from google.appengine.datastore import datastore_query
    def reverse_cursor(cursor):
        return datastore_query.Cursor.from_websafe_string(cursor).reversed().to_websafe_string()
    

    I’ll store this in my utils.py and getting a reversed cursor should be simple.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am using JSon response to parse title,date content and thumbnail images and place
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.