heynemann / motorengine

Motorengine is a port of MongoEngine for Tornado.
http://motorengine.readthedocs.org
204 stars 67 forks source link

Overriding fields during class inheritance #102

Open ghost opened 8 years ago

ghost commented 8 years ago
class ProductImage(Document):
    # ...

class Product(Document):
    # ...
    images = fields.ListField(fields.EmbeddedDocumentField(ProductImage))
# ...
class ModelImage(ProductImage):
    # ...

class Model(Product):
    # ...
    images = fields.ListField(fields.EmbeddedDocumentField(ModelImage))

Why not make a redefinition of fields, instead of checking the uniqueness?