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 9208601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:39:05+00:00 2026-06-18T00:39:05+00:00

I have a GAE datastore with 303 Game() entities. class Game(db.Model): title = db.StringProperty(required

  • 0

I have a GAE datastore with 303 Game() entities.

class Game(db.Model):
    title = db.StringProperty(required = True)
    slug = db.StringProperty(required = True)
    category = db.CategoryProperty()
    description = db.TextProperty(required = True)
    created = db.DateTimeProperty(auto_now_add = True)

The ‘slug’ property is similar to the title except that it replaces all whitespace with a hyphen and removes all special characters. ex: (‘The First Game!’ becomes ‘the-first-game’)

On the website I am listing all 303 games using the Bootstrap collapse accordion. It works fine, however because there are so many games, I attempting to setup a side nav that lists the letters of the alphabet. The user would click on one of the letters to jump to the specific position of the list. ex: (User clicks ‘N’, page jumps to games that start with ‘N’).

I know this works, because if I hard code the ‘slug’ into the HTML it will correctly jump to desired location. However, the ‘slug’ needs to be one before the correct ‘slug’ or it won’t jump correctly. ex: (User clicks ‘N’, the slug in the HTML needs to be ‘my-last-m-game’ to jump to the correct position, and display ‘N’ games at the top of the page).

My question (sorry for the long winded explanation) is, is it possible to do a GQL query to get the last game for each letter of the alphabet? Or is it better to put all the games in a list/dictionary and get the correct ‘slug’ that way? Or should I add a property to the data itself, that allows me to GQL search just for the ‘A’ games or just for the ‘T’ games, to get the correct ‘slug’. Or is there an offset I could use in Bootstrap, that would allow me to get the first ‘N’ game ‘slug’ and use that to jump to the correct position on the page?

Thanks for any help you can offer. It’s my first time posting to stackoverflow, apologies if I’m not doing it correctly.

  • 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-18T00:39:06+00:00Added an answer on June 18, 2026 at 12:39 am

    Another option is to have a field on Game called lastGameForLetter )which is set to null for most games). When you insert a game, it will require an extra check to make sure this doesn’t need to be updated but makes the querying much easier. We do things like this all the time for things that are written rarely but read often.

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

Sidebar

Related Questions

I use jQuery UI autocomplete widget . Also I have GAE datastore: class Person(db.Model):
In GAE, I have a model called Foo, with existing entities, and attempt to
I have a Model in an existing Datastore. Which looks like this: class SomeKind(db.Model):
For all my data in the GAE Datastore I have a model for keeping
I have a persistent class stored in a GAE datastore. I have removed one
I have seen the in GAE datastore there are so many entity which at
I have a GAE Entity called MyFile public class MyFile { static enum LocationEnum
I have a GAE app that uses the java.util.Calendar class. My app changes some
I am a beginner, and am using GAE Datastore - have retrieved values in
I use Objectify for datastore operations in my GAE/Java application. I have used Objectify's

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.