google app engine db.Model in python only display user-defined fields

Posted by MattM on Stack Overflow See other posts from Stack Overflow or by MattM
Published on 2010-05-04T14:05:09Z Indexed on 2010/05/04 14:08 UTC
Read the original article Hit count: 135

I'm a python newbie so I apologize in advance if this question has been asked before.

I am building out an application in GAE and need to generate a report that contains the values for a user-defined subset of fields.

For example, in my db model, CrashReport, I have the following fields:

entry_type entry_date instance_id build_id crash_text machine_info

I present a user with the above list as a checkbox group from which they select. Whichever fields the user selects, I then create a report showing all the values in the datastore, but only for the fields that they selected. For example, if from the above list, the user selects the build_id and crash_text fields, the output might look like this:

build_id crash_text 0.8.2 blown gasket 0.8.2 boom! 0.8.1 crack! ...

So the question is, how exactly do I only access the values for the fields which the user has defined?

© Stack Overflow or respective owner

Related posts about google-app-engine

Related posts about datastore