Hello.
I get this error in production, when i try the code below, which uses
order and filtering on keys, as recently added in SDK version 1.1.6.
(...)
File "/base/python_lib/versions/1/google/appengine/ext/db/
__init__.py", line 1577, in order
raise PropertyError('Invalid property name \'%s\'' % property)
PropertyError: Invalid property name '__key__'
when running:
query = Users.all()
query.order('__key__')
# Use a query parameter to keep track of the last key of the last
# batch, to know where to start the next batch.
last_key_str = self.request.get('last')
if last_key_str:
last_key = db.Key(last_key_str)
query.filter('__key__ >', last_key)
# For batches of 20, fetch 21, then use result #20 as the "last"
# if there is a 21st.
entities = query.fetch(21)
new_last_key_str = None
if len(entities) == 21:
new_last_key_str = str(entities[19].key())
#edit and save each entity
# (...)
# Return the data and new_last_key_str.
self.response.out.write( '<script> setTimeout( "document.location.href=
\'?last='+ new_last_key_str +'\'",500 ) </script>' )
Thanks in advance.
~Thiago
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---