One-to-one relationship
In order to create a one-to-one relationship, the relationship attributes should be defined as Optional
-Required
or as Optional
-Optional
:
class Person(db.Entity):
passport = Optional("Passport")
class Passport(db.Entity):
person = Required("Person")
Defining both attributes as Required
is not allowed because it doesn’t make sense.