Thanks, that worked like a charm.
On Apr 30, 12:28 am, Ross Ridge <rri...@csclub.uwaterloo.ca> wrote:
palp wrote:
This is a pretty straighforward question, but I haven't seen much
detail on how ReferenceProperty actually works under the hood. I
have an entity that has a reference to another entity. I want to use
the application cache to minimize lookups of entities. If I do
entity.reference.key(), am I saving anything at all, or does it cost
the same as accessing the properties of the reference?
I don't think it saves you anything at all. Looking at the source for
the ReferenceProperty class in the SDK, I think you'd have to
something like this:
key = type(entity).reference.get_value_for_datastore(entity)
By accessing the property through the entity's class rather than the
entity, you can get the property itself rather than entity it refers
to. You can replace "type(entity)" with the name of the entiy's
class.
Ross Ridge