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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:57:54+00:00 2026-05-11T03:57:54+00:00

Has anyone tried to dynamically select which properties they want to write to an

  • 0

Has anyone tried to dynamically select which properties they want to write to an entity on appengine? For example:

I have a web form with 5 fields, and any given user will fill out some subset of those fields. I POST only the fields with data to the server (e.g. Fields 1,2,4). On the server side, how do I elegantly write only properties 1,2, and 4? The Model class has a function that returns a dictionary of property names (Model.properties()), but how would I use it to select property names?

In SQL, I would build an INSERT or UPDATE statement by matching the fields POSTed against the Model.properties() dictionary. I would look at the db module code in the Appengine SDK, to see if the Model class had some collection of Property objects, but I can’t find the module on my disk (I’m a little new to python and appengine).

Update: I read trunk/google/appengine/ext/db/init.py which confirmed that there is no way to refer to the properties as a group. Anyone know of a workaround?

Any thoughts?

Update2: This question was answered on the Google Group for AppEngine: http://groups.google.com/group/google-appengine/browse_thread/thread/b50be862f6d94b6e#

  • 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. 2026-05-11T03:57:55+00:00Added an answer on May 11, 2026 at 3:57 am

    The python module will look something like this:

    from google.appengine.ext.db import Key from google.appengine.api.datastore import Get, Put  def edit_item(request, db_id):      objKey = Key(str(db_id))      if request.method == 'POST':         objEntity = Get(objKey)         for k, v in request.POST.iteritems():              objEntity[k]=v         Put(objEntity)         return HttpResponseRedirect('/')      query = TestModel.get(objKey)     return render_to_response('edit.html', ({'modify_data': query,})) 

    Your HTML should look something like this:

    <form method='POST' action='.' enctype='multipart/form-data'>   Title: <input type='text' name='title' value='{{modify_data.field1}}'/>   Text: <input type='text' name='txt' value='{{modify_data.field2}}'/>    <input type='submit'/> </form> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone tried the ActiveRecord Intro Sample with C# 3.5? I somehow have the
Has anyone tried installing SQL Server 2008 Developer on a machine that already has
Has anyone ever tried, or had any success at getting Wascana (Eclipse CDT +
Has anyone already tried this, anything particulair that I need to be aware of?
has anyone ever tried to get the list of all the movieclips (even the
Has anyone seen anything in Tix work under python 3.0? I've tried to work
Anyone who has tried to implement RoutedCommands in WPF using M-V-VM has undoubtedly run
I have a page that has 3 used controls that are dynamically added to
Has anyone tried to use gold instead of ld ? gold promises to be
Has anyone tried to replace NUnit tests with MS Test, and would be willing

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.