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

  • SEARCH
  • Home
  • 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 6575403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:22:57+00:00 2026-05-25T15:22:57+00:00

My lookup uses the :offset option (say, :offset => 50 ) and the pages

  • 0

My lookup uses the :offset option (say, :offset => 50) and the pages using this lookup are paginated. So page 1 begins with the record whose ID is 51.

The problem is that the first 50 records never get to show up, because the lookup doesn’t “wrap around”. That is, if there are 200 total records, and I do :offset => 50, the collection from the lookup does not include records 1-50. Is there any way to instruct the lookup to “wrap around”, so that it includes all 200 records – but they are ordered such that they begin at record #51?

  • 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-05-25T15:22:58+00:00Added an answer on May 25, 2026 at 3:22 pm

    Offset are only for limiting which records are selected; so you shouldn’t use that if you want everything. If your page sizes are 50 and you can assume your records are always perfectly in sequence (probably not a good long term assumption), you can specify an order like:

    Model.order('id < 50, id')
    

    If you’re loading these records all at once anyway, rotating the records in memory may be okay if the dataset remains manageable:

    Model.all.rotate(50)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do you create a lookup column to a Document Library that uses the
I have a Django form that uses an integer field to lookup a model
I'm trying to build a MySQL query that uses the rows in a lookup
I am using jboss-as-7.1.0.Final-SNAPSHOT and trying to set up custom login module that uses
I have a database that uses a custom model for recording lookup valus (i.e.
I'm writing a Java Tomcat intranet app that uses NTLM to lookup a user's
I am using django-postman to provide user-to-user message facility and this uses django ajax-selects
When retrieving a lookup code value from a table, some folks do this... Dim
The MSDN explains Lookup like this: A Lookup<TKey, TElement> resembles a Dictionary<TKey, TValue> .
I have a few lookup tables that I am in the process of plumbing

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.