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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:57:10+00:00 2026-06-02T19:57:10+00:00

first time post and new to google app engine! i can’t for the life

  • 0

first time post and new to google app engine!

i can’t for the life of me figure out why my attempts to access an object using Model.get_by_id does not function.

my test data is populated and i can verify the output as commented. i can confirm the ID of the data in the Datastore viewer… but attempts to use that ID fail to return the object.

    namespace_manager.set_namespace('myNamespace')

    for t in models.MyClass.all().fetch(100):
        print t.key().id() # prints the key and verified in the Datastore Viewer
        print t.date # prints the date

        myClassInstance = models.MyClass.get_by_id(t.key().id()) # never finds the object
        if tour is None:
            print "MyClass instance not found"

so output is

    6
    2012-04-24 20:47:13.537000
    MyClass instance not found
    27
    2012-04-24 20:47:13.605000
    MyClass instance not found
    29
    2012-04-24 20:47:13.611000
    MyClass instance not found
    31
    2012-04-24 20:47:13.617000
    MyClass instance not found

note that this is not a root entity and has children as well… but shouldn’t the MyClass.get_by_id method return the correct object?

thanks in advance!

  • 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-02T19:57:15+00:00Added an answer on June 2, 2026 at 7:57 pm

    if you are creating your entities with a parent/ancestor you need to provide that to the get_by_id function too.

    entity = MyModel(parent = parentkey,
                     name   = 'somename')
    entity.put()
    
    entity_by_id = MyModel.get_by_id(entity.key().id(), parent = parentkey)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Every time I try to post to twitter in my rails app, the first
I'm attempting my first google app engine project – a simple player stats database
This is my first time here so I hope I post this question at
this is my first post on this website, but I'm all the time getting
First time I post a question, so here it goes. I want to push
first time trying XNA Framework in C#.. followed this tutorial: http://www.uxmagic.com/blog/post/2010/08/17/e2809cHello-Worlde2809d-for-XNA-Game-Studio-40.aspx Everything's ok until
When calling session_start() for the first time, a new session will be generated. Later,
Hi guys this will be my first post and am pretty new to Objective-C
First time asking a question here. Usually I can find my answer without having
I've written my first Python application with the App Engine APIs, it is intended

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.