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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:55:42+00:00 2026-05-25T11:55:42+00:00

I have a ‘Calculation’ entity in my datastore with say, 7 million objects under

  • 0

I have a ‘Calculation’ entity in my datastore with say, 7 million objects under that entity. It has the following properties (python runtime):

class Calculation(db.Model):
    question = db.StringProperty(required=True)
    answer = db.StringProperty()

suppose examples of the ‘question’ property are things like ‘1+1’, ‘2+2’, ‘3+3’ (not really important). All the calculation objects start out with empty answer properties.

When a user connects to the app, an ajax call is made and my app is supposed to [1] fetch a Calculation object with an empty answer property and send it to the user’s browser. The user’s browser then evaluates the question and sends it back to a different server handler.

How do I update that specific Calculation object’s answer property[2]?

If someone could provide me with code for [1] and [2] that would be great. Not really experienced with App Engine and the query stuff is confusing. What is the best solution for this if I want to conserve as much server-CPU as possible?

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-25T11:55:42+00:00Added an answer on May 25, 2026 at 11:55 am

    I don’t know if i have really understand. But you simply need to return for your first ajax call the key of the entity Calculation and the question. When the user makes a response you firstly get the entity by the key and update the property answer.

    Step 1, The ajax call return a question in JSON (for example):

    # To fetch an empty answered question
    qry = Calculation.All().filter('answer =', None)
    ref = qry.get()
    
    # The Json response
    { 'key': unicode(ref.key()),
      'question': ref.question}
    

    Step 2, You update the entity by the key:

    # key and answer are variable from an http GET or POST request.
    ref = db.get(key)
    ref.answer = answer
    ref.put()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have you managed to get Aptana Studio debugging to work? I tried following this,
Have created simple Ajax enabled contact forms before that have around 12 fields -
Have a LinqtoSql query that I now want to precompile. var unorderedc = from
Have some data in a sybase image type column that I want to use
I've got a string that has curly quotes in it. I'd like to replace
Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
Have a bunch of WCF REST services hosted on Azure that access a SQL
Have been following Rails Tutorial by Michael Hart rails version 3.0 on mac OS
Have some dates in my local Oracle 11g database that are in this format:
have the following text file: <div> <asp:HyperLinkField HeaderText=Hello World of Regular Expression /> </div>

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.