diff --git a/src/typeclasses/managers.py b/src/typeclasses/managers.py index c59b4d2d3b..fd07bdd853 100644 --- a/src/typeclasses/managers.py +++ b/src/typeclasses/managers.py @@ -51,6 +51,7 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager): Overload the standard get. This will limit itself to only return the current typeclass. """ + print self.model kwargs.update({"db_typeclass_path":self.model.path}) return super(TypedObjectManager, self).get(**kwargs) @@ -68,7 +69,7 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager): """ return super(TypedObjectManager, self).all(**kwargs).filter(db_typeclass_path=self.model.path) - def get_inherit(self, **kwargs): + def get_family(self, **kwargs): """ Variation of get that not only returns the current typeclass but also all subclasses of that typeclass. @@ -78,7 +79,7 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager): kwargs.update({"db_typeclass_path__in":paths}) return super(TypedObjectManager, self).get(**kwargs) - def filter_inherit(self, **kwargs): + def filter_family(self, **kwargs): """ Variation of filter that allows results both from typeclass and from subclasses of typeclass @@ -89,7 +90,7 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager): kwargs.update({"db_typeclass_path__in":paths}) return super(TypedObjectManager, self).filter(**kwargs) - def all_inherit(self, **kwargs): + def all_family(self, **kwargs): """ Return all matches, allowing matches from all subclasses of the typeclass. diff --git a/src/utils/idmapper/base.py b/src/utils/idmapper/base.py index 5922384ee8..b26c53ff28 100755 --- a/src/utils/idmapper/base.py +++ b/src/utils/idmapper/base.py @@ -425,23 +425,13 @@ class SharedMemoryModelBase(ModelBase): new_class._meta.apps.register_model(new_class._meta.app_label, new_class) return new_class -class TypeclassModelBase(SharedMemoryModelBase): - """ - Metaclass for typeclasses - """ def __init__(cls, *args, **kwargs): """ - We must define our Typeclasses as proxies. We also store the path - directly on the class, this is useful for managers. + This is for the typeclass system. """ - super(TypeclassModelBase, cls).__init__(*args, **kwargs) - class Meta: - proxy = True - cls.Meta = Meta cls.typename = cls.__name__ cls.path = "%s.%s" % (cls.__module__, cls.__name__) - class SharedMemoryModel(Model): # CL: setting abstract correctly to allow subclasses to inherit the default # manager.