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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:02:06+00:00 2026-05-13T15:02:06+00:00

Using Google App Engine SDK and Python, I’m facing an issue : I’m unable

  • 0

Using Google App Engine SDK and Python, I’m facing an issue : I’m unable to access the ID property of a given entity properties. The only properties I can access are those defined in my class Model, plus the key property (see answer below) :

class Question(db.Model):
    text = db.StringProperty()
    answers = db.StringListProperty()
    user = db.UserProperty()
    datetime = db.DateTimeProperty()

I can access text, answers, user, datetime and key properties just fine. However, I can’t access the ID property.
For example, after fetching all entities (using Question.all()) :

# OK Within a template, this will return a string :
{{ question.text }}
# OK, this will return the entity key :
{{ question.key }}

# KO this will return nothing :
{{ question.id }}

Any ideas ? 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-05-13T15:02:06+00:00Added an answer on May 13, 2026 at 3:02 pm

    According to the documentation, there is no id() instance method defined for Model subclasses.

    Try {{ question.key }} instead.

    Also note that the key is not created until the entity is saved to the datastore.


    Edit: more info based on OP’s edit:

    Since we’re really after the numeric ID, we could do something like this in our template:

    {{ question.key.id }}

    Another note: you should never expect numeric IDs to increase in value corresponding with the order of entity creation. In practice, this is usually—but not always—the case.

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

Sidebar

Related Questions

Using Google App Engine (python SDK), I created a custom JSONProperty() as a subclass
I am using Google App Engine (python), I want my users to be able
I am using google app engine in python with a Jinja2 template engine. This
I am using Google App Engine with Google's JDO implementation to save an entity
I'm using Python 2.7 and django-nonrel for running Django projects on Google app engine.
I'm using Google App Engine (Python), and using OpenID for login. Specifically, I'm playing
I'm using Google App Engine, Python and JQuery. My application is similar to Twitter
I'm using Google App Engine's version of Django templates in Python. Is there a
We are currently using Google App Engine to evaluate solutions to Python problems submitted
I'm trying to implement Federated Login using Google App Engine Go SDK, but the

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.