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)
···
________________________________
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:
···
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)
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.