I have an Entity that has a variable sum of another Entity in it (so I use Structured Property, repeat = True), but this one property can contain a variable of the same entity type. So my code looks like this:
class Property(ndb.Model):
name = ndb.StringProperty()
cost = ndb.FloatProperty()
type = ndb.StringProperty()
class SpecialProperty(ndb.Model):
name = ndb.StringProperty()
properties = ndb.StructuredProperty(Property, repeated=True)
type = ndb.StringProperty()
class Hotel(ndb.Model):
specialProperties = ndb.StructuredProperty(SpecialProperty, repeated=True)
But when I try, this GAE causes an error.
"TypeError: this StructuredProperty cannot use repeat = True because its model class (SpecialProperty) contains duplicate properties (directly or indirectly).
So how can I get around this? I really need to have this flexible structure.
Thank you very much in advance.
source
share