X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/3cca0bf2f0e4ff926b8e3aa598d6693561a7bab4..bf8e7237a705e2db952d94e7acde3b9f7a99ef91:/models/base.py?ds=inline diff --git a/models/base.py b/models/base.py index faac89b..af1e880 100644 --- a/models/base.py +++ b/models/base.py @@ -271,9 +271,9 @@ class EntityOptions(object): class EntityBase(models.base.ModelBase): def __new__(cls, name, bases, attrs): + entity_meta = attrs.pop('EntityMeta', None) new = super(EntityBase, cls).__new__(cls, name, bases, attrs) - entity_options = attrs.pop('EntityMeta', None) - setattr(new, '_entity_meta', EntityOptions(entity_options)) + new.add_to_class('_entity_meta', EntityOptions(entity_meta)) entity_class_prepared.send(sender=new) return new