diff --git a/evennia/accounts/accounts.py b/evennia/accounts/accounts.py index 969e8f9d04..d83b14f856 100644 --- a/evennia/accounts/accounts.py +++ b/evennia/accounts/accounts.py @@ -777,7 +777,7 @@ class DefaultAccount(with_metaclass(TypeclassBase, AccountDB)): # any was deleted in the interim. self.db._playable_characters = [char for char in self.db._playable_characters if char] self.msg(self.at_look(target=self.db._playable_characters, - session=session)) + session=session), session=session) def at_failed_login(self, session, **kwargs): """ diff --git a/evennia/comms/comms.py b/evennia/comms/comms.py index 7ff62dfc27..a7d74ae0e4 100644 --- a/evennia/comms/comms.py +++ b/evennia/comms/comms.py @@ -97,7 +97,8 @@ class DefaultChannel(with_metaclass(TypeclassBase, ChannelDB)): @property def wholist(self): 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: # display listening subscribers in bold string = ", ".join([account.key if account not in listening else "|w%s|n" % account.key for account in subs]) diff --git a/evennia/contrib/tutorial_world/objects.py b/evennia/contrib/tutorial_world/objects.py index b260770577..0561f98d03 100644 --- a/evennia/contrib/tutorial_world/objects.py +++ b/evennia/contrib/tutorial_world/objects.py @@ -674,7 +674,7 @@ class CrumblingWall(TutorialObject, DefaultExit): # we found the button by moving the roots result = ["Having moved all the roots aside, you find that the center of the wall, " "previously hidden by the vegetation, hid a curious square depression. It was maybe once " - "concealed and made to look a part of the wall, but with the crumbling of stone around it," + "concealed and made to look a part of the wall, but with the crumbling of stone around it, " "it's now easily identifiable as some sort of button."] elif self.db.exit_open: # we pressed the button; the exit is open diff --git a/evennia/typeclasses/managers.py b/evennia/typeclasses/managers.py index 25488f4987..2ff78d310e 100644 --- a/evennia/typeclasses/managers.py +++ b/evennia/typeclasses/managers.py @@ -653,6 +653,42 @@ class TypeclassManager(TypedObjectManager): """ 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): """ Recursively get all subclasses to a class.