Merge branch 'master' into develop
This commit is contained in:
commit
63cae2b187
4 changed files with 40 additions and 3 deletions
|
|
@ -777,7 +777,7 @@ class DefaultAccount(with_metaclass(TypeclassBase, AccountDB)):
|
||||||
# any was deleted in the interim.
|
# any was deleted in the interim.
|
||||||
self.db._playable_characters = [char for char in self.db._playable_characters if char]
|
self.db._playable_characters = [char for char in self.db._playable_characters if char]
|
||||||
self.msg(self.at_look(target=self.db._playable_characters,
|
self.msg(self.at_look(target=self.db._playable_characters,
|
||||||
session=session))
|
session=session), session=session)
|
||||||
|
|
||||||
def at_failed_login(self, session, **kwargs):
|
def at_failed_login(self, session, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,8 @@ class DefaultChannel(with_metaclass(TypeclassBase, ChannelDB)):
|
||||||
@property
|
@property
|
||||||
def wholist(self):
|
def wholist(self):
|
||||||
subs = self.subscriptions.all()
|
subs = self.subscriptions.all()
|
||||||
listening = [ob for ob in subs if ob.is_connected and ob not in self.mutelist]
|
muted = list(self.mutelist)
|
||||||
|
listening = [ob for ob in subs if ob.is_connected and ob not in muted]
|
||||||
if subs:
|
if subs:
|
||||||
# display listening subscribers in bold
|
# display listening subscribers in bold
|
||||||
string = ", ".join([account.key if account not in listening else "|w%s|n" % account.key for account in subs])
|
string = ", ".join([account.key if account not in listening else "|w%s|n" % account.key for account in subs])
|
||||||
|
|
|
||||||
|
|
@ -653,6 +653,42 @@ class TypeclassManager(TypedObjectManager):
|
||||||
"""
|
"""
|
||||||
return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).count()
|
return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).count()
|
||||||
|
|
||||||
|
def annotate(self, *args, **kwargs):
|
||||||
|
"""
|
||||||
|
Overload annotate method to filter on typeclass before annotating.
|
||||||
|
Args:
|
||||||
|
*args (any): Positional arguments passed along to queryset annotate method.
|
||||||
|
**kwargs (any): Keyword arguments passed along to queryset annotate method.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Annotated queryset.
|
||||||
|
"""
|
||||||
|
return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).annotate(*args, **kwargs)
|
||||||
|
|
||||||
|
def values(self, *args, **kwargs):
|
||||||
|
"""
|
||||||
|
Overload values method to filter on typeclass first.
|
||||||
|
Args:
|
||||||
|
*args (any): Positional arguments passed along to values method.
|
||||||
|
**kwargs (any): Keyword arguments passed along to values method.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Queryset of values dictionaries, just filtered by typeclass first.
|
||||||
|
"""
|
||||||
|
return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).values(*args, **kwargs)
|
||||||
|
|
||||||
|
def values_list(self, *args, **kwargs):
|
||||||
|
"""
|
||||||
|
Overload values method to filter on typeclass first.
|
||||||
|
Args:
|
||||||
|
*args (any): Positional arguments passed along to values_list method.
|
||||||
|
**kwargs (any): Keyword arguments passed along to values_list method.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Queryset of value_list tuples, just filtered by typeclass first.
|
||||||
|
"""
|
||||||
|
return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).values_list(*args, **kwargs)
|
||||||
|
|
||||||
def _get_subclasses(self, cls):
|
def _get_subclasses(self, cls):
|
||||||
"""
|
"""
|
||||||
Recursively get all subclasses to a class.
|
Recursively get all subclasses to a class.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue