I tried to use projection queries:

class Article(db.Model):
title = db.StringProperty(required=True)
# others...

print db.Query('Article', projection=('title')).get()

> Traceback (most recent call last):
>   File
> "/base/python_runtime/python_lib/versions/1/google/appengine/ext/admin/__init__.py",
> line 331, in post
>     exec(compiled_code, globals())
>   File "<string>", line 3, in <module>
>   File
> "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py",
> line 2098, in get
>     results = self.run(limit=1, **kwargs)
>   File
> "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py",
> line 2061, in run
>     raw_query = self._get_query()
>   File
> "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py",
> line 2446, in _get_query
>     kind = self._model_class.kind()
> AttributeError: 'str' object has no attribute 'kind'


print db.GqlQuery("SELECT title FROM Article").get().title
# this one works

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to