Accessing ODK data in Google App Engine

I've posted this question to several groups and to StackOverflow but no one has been able to answer this yet. I thought it would be simple, but is it just not possible?

I'm trying to access data that ODK has pushed into the datastore. The below code words fine when I query an entity that I created via Python, which was called "ProductSalesData". The entity name ODK has given its data is "opendatakit.test1". When I update the data model to class opendatakit.test1(db.Model) it obviously bombs due to a sytax error. Any ideas on how to access the ODK data? My goal is to move the data into big query like like codelab example(https://developers.google.com/bigquery/articles/datastoretobigquery).

#!/usr/bin/env python
import webapp2
from google.appengine.ext import db

class ProductSalesData(db.Model):
product_id = db.IntegerProperty()
date = db.DateTimeProperty()
store = db.StringProperty()
q = ProductSalesData.all()

class simplequery(webapp2.RequestHandler):
def get(self):
for ProductSalesData in q:
self.response.out.write('Result:%s
' % ProductSalesData.store)

app = webapp2.WSGIApplication(
[('/', simplequery)],
debug=True)

Thank You

David Pulaski | Lead Programmer Analyst | Abt Associates
O: 617.520.3514 | C: 781.718.5191 | www.abtassociates.comhttp://www.abtassociates.com/

··· ________________________________ This message may contain privileged and confidential information intended solely for the addressee. Please do not read, disseminate or copy it unless you are the intended recipient. If this message has been received in error, we kindly ask that you notify the sender immediately by return email and delete all copies of the message from your system.

You won't be able to do this in Python because of the way the tables map,
unless there is a way to define a table alias instead of having it exactly
match the Python class name.

If you want to try modifying ODK Aggregate to not have the dot, you can
change this line:

http://code.google.com/p/opendatakit/source/browse/src/main/java/org/opendatakit/common/persistence/engine/gae/DatastoreImpl.java?repo=aggregate#198

··· On Tue, Feb 11, 2014 at 5:00 AM, David Pulaski wrote:

I've posted this question to several groups and to StackOverflow but no
one has been able to answer this yet. I thought it would be simple, but is
it just not possible?

I'm trying to access data that ODK has pushed into the datastore. The
below code words fine when I query an entity that I created via Python,
which was called "ProductSalesData". The entity name ODK has given its data
is "opendatakit.test1". When I update the data model to class
opendatakit.test1(db.Model) it obviously bombs due to a sytax error. Any
ideas on how to access the ODK data? My goal is to move the data into big
query like like codelab example(
https://developers.google.com/bigquery/articles/datastoretobigquery).

#!/usr/bin/env python
import webapp2
from google.appengine.ext import db

class ProductSalesData(db.Model):
product_id = db.IntegerProperty()
date = db.DateTimeProperty()
store = db.StringProperty()
q = ProductSalesData.all()

class simplequery(webapp2.RequestHandler):
def get(self):
for ProductSalesData in q:
self.response.out.write('Result:%s
' % ProductSalesData.store)

app = webapp2.WSGIApplication(
[('/', simplequery)],
debug=True)

Thank You

*David Pulaski | *Lead Programmer Analyst | Abt Associates

O: 617.520.3514 | C: 781.718.5191 | www.abtassociates.com


This message may contain privileged and confidential information intended
solely for the addressee. Please do not read, disseminate or copy it unless
you are the intended recipient. If this message has been received in error,
we kindly ask that you notify the sender immediately by return email and
delete all copies of the message from your system.

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com