Refactor wrong super() parents in a few managers.
This commit is contained in:
parent
4699b38b31
commit
a09835049b
5 changed files with 13 additions and 13 deletions
|
|
@ -864,7 +864,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
self.location = None # this updates contents_cache for our location
|
self.location = None # this updates contents_cache for our location
|
||||||
|
|
||||||
# Perform the deletion of the object
|
# Perform the deletion of the object
|
||||||
super(ObjectDB, self).delete()
|
super(DefaultObject, self).delete()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def access(self, accessing_obj, access_type='read', default=False, no_superuser_bypass=False, **kwargs):
|
def access(self, accessing_obj, access_type='read', default=False, no_superuser_bypass=False, **kwargs):
|
||||||
|
|
|
||||||
|
|
@ -382,7 +382,7 @@ class DefaultPlayer(with_metaclass(TypeclassBase, PlayerDB)):
|
||||||
self.attributes.clear()
|
self.attributes.clear()
|
||||||
self.nicks.clear()
|
self.nicks.clear()
|
||||||
self.aliases.clear()
|
self.aliases.clear()
|
||||||
super(PlayerDB, self).delete(*args, **kwargs)
|
super(DefaultPlayer, self).delete(*args, **kwargs)
|
||||||
## methods inherited from database model
|
## methods inherited from database model
|
||||||
|
|
||||||
def msg(self, text=None, from_obj=None, session=None, options=None, **kwargs):
|
def msg(self, text=None, from_obj=None, session=None, options=None, **kwargs):
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class SSLProtocol(TelnetProtocol):
|
||||||
is done with encryption.
|
is done with encryption.
|
||||||
"""
|
"""
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(TelnetProtocol, self).__init__(*args, **kwargs)
|
super(SSLProtocol, self).__init__(*args, **kwargs)
|
||||||
self.protocol_name = "ssl"
|
self.protocol_name = "ssl"
|
||||||
|
|
||||||
def verify_SSL_key_and_cert(keyfile, certfile):
|
def verify_SSL_key_and_cert(keyfile, certfile):
|
||||||
|
|
|
||||||
|
|
@ -535,7 +535,7 @@ class TypeclassManager(TypedObjectManager):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
kwargs.update({"db_typeclass_path":self.model.path})
|
kwargs.update({"db_typeclass_path":self.model.path})
|
||||||
return super(TypedObjectManager, self).get(**kwargs)
|
return super(TypeclassManager, self).get(**kwargs)
|
||||||
|
|
||||||
def filter(self, *args, **kwargs):
|
def filter(self, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
@ -553,7 +553,7 @@ class TypeclassManager(TypedObjectManager):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
kwargs.update({"db_typeclass_path":self.model.path})
|
kwargs.update({"db_typeclass_path":self.model.path})
|
||||||
return super(TypedObjectManager, self).filter(*args, **kwargs)
|
return super(TypeclassManager, self).filter(*args, **kwargs)
|
||||||
|
|
||||||
def all(self):
|
def all(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -563,7 +563,7 @@ class TypeclassManager(TypedObjectManager):
|
||||||
objects (queryset): The objects found.
|
objects (queryset): The objects found.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return super(TypedObjectManager, self).all().filter(db_typeclass_path=self.model.path)
|
return super(TypeclassManager, self).all().filter(db_typeclass_path=self.model.path)
|
||||||
|
|
||||||
def first(self):
|
def first(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -577,7 +577,7 @@ class TypeclassManager(TypedObjectManager):
|
||||||
on the model base used.
|
on the model base used.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return super(TypedObjectManager, self).filter(db_typeclass_path=self.model.path).first()
|
return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).first()
|
||||||
|
|
||||||
def last(self):
|
def last(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -591,7 +591,7 @@ class TypeclassManager(TypedObjectManager):
|
||||||
on the model base used.
|
on the model base used.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return super(TypedObjectManager, self).filter(db_typeclass_path=self.model.path).last()
|
return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).last()
|
||||||
|
|
||||||
def count(self):
|
def count(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -601,7 +601,7 @@ class TypeclassManager(TypedObjectManager):
|
||||||
integer : Number of objects found.
|
integer : Number of objects found.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return super(TypedObjectManager, self).filter(db_typeclass_path=self.model.path).count()
|
return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).count()
|
||||||
|
|
||||||
def _get_subclasses(self, cls):
|
def _get_subclasses(self, cls):
|
||||||
"""
|
"""
|
||||||
|
|
@ -634,7 +634,7 @@ class TypeclassManager(TypedObjectManager):
|
||||||
paths = [self.model.path] + ["%s.%s" % (cls.__module__, cls.__name__)
|
paths = [self.model.path] + ["%s.%s" % (cls.__module__, cls.__name__)
|
||||||
for cls in self._get_subclasses(self.model)]
|
for cls in self._get_subclasses(self.model)]
|
||||||
kwargs.update({"db_typeclass_path__in":paths})
|
kwargs.update({"db_typeclass_path__in":paths})
|
||||||
return super(TypedObjectManager, self).get(**kwargs)
|
return super(TypeclassManager, self).get(**kwargs)
|
||||||
|
|
||||||
def filter_family(self, *args, **kwargs):
|
def filter_family(self, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
@ -655,7 +655,7 @@ class TypeclassManager(TypedObjectManager):
|
||||||
paths = [self.model.path] + ["%s.%s" % (cls.__module__, cls.__name__)
|
paths = [self.model.path] + ["%s.%s" % (cls.__module__, cls.__name__)
|
||||||
for cls in self._get_subclasses(self.model)]
|
for cls in self._get_subclasses(self.model)]
|
||||||
kwargs.update({"db_typeclass_path__in":paths})
|
kwargs.update({"db_typeclass_path__in":paths})
|
||||||
return super(TypedObjectManager, self).filter(*args, **kwargs)
|
return super(TypeclassManager, self).filter(*args, **kwargs)
|
||||||
|
|
||||||
def all_family(self):
|
def all_family(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -668,6 +668,6 @@ class TypeclassManager(TypedObjectManager):
|
||||||
"""
|
"""
|
||||||
paths = [self.model.path] + ["%s.%s" % (cls.__module__, cls.__name__)
|
paths = [self.model.path] + ["%s.%s" % (cls.__module__, cls.__name__)
|
||||||
for cls in self._get_subclasses(self.model)]
|
for cls in self._get_subclasses(self.model)]
|
||||||
return super(TypedObjectManager, self).all().filter(db_typeclass_path__in=paths)
|
return super(TypeclassManager, self).all().filter(db_typeclass_path__in=paths)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -653,7 +653,7 @@ class EvEditor(object):
|
||||||
if savefunc:
|
if savefunc:
|
||||||
self._savefunc = savefunc
|
self._savefunc = savefunc
|
||||||
else:
|
else:
|
||||||
self._savefunc = lambda caller: caller.msg(_ERROR_NO_SAVEFUNC)
|
self._savefunc = lambda caller, buffer: caller.msg(_ERROR_NO_SAVEFUNC)
|
||||||
if quitfunc:
|
if quitfunc:
|
||||||
self._quitfunc = quitfunc
|
self._quitfunc = quitfunc
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue