I have an Entity which has a variable amount of another Entity in it (so I'm usingStructured Property, repeated=True), but that one property can hold variable amount of single entity kind as well. 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 throws an error. "TypeError: This StructuredProperty cannot use repeated=True because its model class (SpecialProperty) contains repeated properties (directly or indirectly)."
So how can I bypass this? I really need to have this flexible structure.
Big thanks in advance.