I am working on a simple online database for sharing technical equipment between artists.
I would like to let a class User()
own entities of other classes such as a Lamp()
or a Speaker()
.
It seems that I could be using ReferenceProperty
when using db, but when I look through the documentation for ndb
it seems a bit confusing to me, as I can't find ReferenceProperty
.
So If, using ndb
, I want to let an entity of the class Lamp()
be owned by an entity of the class User()
, by referencing the id of a User()
, what should I do? Wanting it to be something like what I have written below, although I am pretty confident that what I have written below does not in fact work:
class User(ndb.Model):
name = ndb.StringProperty()
email = ndb.....
class Lamp(db.Model):
owner = db.ReferenceProperty(User)