Is to possible to create one-to-one relations in the Python version of Google App Engine? I know it is possible in Java.
views:
34answers:
1
+3
A:
Sure - just use a ReferenceProperty that references an entity not referenced by anything else.
Nick Johnson
2010-06-30 12:53:46
So there is no way to enforce the constraint
Casebash
2010-06-30 12:57:41
I don't believe there is in Java, either. You could have each entity mutually reference the other, and check the reference any time you use it, I suppose. What's your use-case?
Nick Johnson
2010-06-30 13:31:32
Java provides it [here](http://code.google.com/appengine/docs/java/datastore/relationships.html#Owned_One_to_One_Relationships). I don't have a use case atm, just seems like a logical thing to have
Casebash
2010-06-30 23:51:03
That's an 'owned' relationship, so it's equivalent to a parent entity in Python. Simply creating an entity with parent=other_entity and a known key is equivalent to this.
Nick Johnson
2010-07-01 08:38:07