[google-appengine] How to determine existence of properties in an Entity

2 views
Skip to first unread message

Kwame

unread,
May 1, 2010, 4:59:35 AM5/1/10
to Google App Engine
How does one test for the presence or absence of a particular property
in an Entity? I looked through the docs:
http://code.google.com/appengine/docs/python/datastore/gqlreference.html
and only found this statement about it:

"Note: conditions of the form property = NULL (which are equivalent)
check to see whether a null value is explicitly stored in the
datastore for that property. This is not the same as checking to see
if the entity lacks any value for the property! Datastore queries
which refer to a property never return entities which don't have some
value for that property."

However it dosen't say what to actually do to determine this
condition.

--
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-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Tim Hoffman

unread,
May 1, 2010, 6:00:18 AM5/1/10
to Google App Engine
Hi

You can't in a query, the indexes only index values that exist, you
would have to explicitly set properties to None or some other sentinal
value by default to find objects that haven't had a property set.

Rgds

T
Reply all
Reply to author
Forward
0 new messages