I am doing a project in google app engine. Python is used in the back end. I have a datastore table “Data” with following attributes,
class Data(db.Model):
url = db.StringProperty
code = db.StringProperty
turl = db.StringProperty
I used following lines of code to get all values from the table,
x = Data.all()
x = db.GqlQuery("SELECT * FROM Data")
ourl = x.fetch(10)
When i print it using the following code,
for p in ourl:
print "%s %s, %s " % (p.url, p.code, p.turl)
i got 10 times the following message,
<class 'google.appengine.ext.db.StringProperty'> <class 'google.appengine.ext.db.StringProperty'>, <class 'google.appengine.ext.db.StringProperty'>
I cannot get the real values of url,code and turl. What to do with this code??
In your
class Datayou forgot parenthesis to create instances of property.Currently your simply copy the class
db.StringPropertyin your attributes defined in yourclass Data