mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 04:27:16 +02:00
Have Msg access methods return typeclasses where appropriate instead of dbobjs, to make it more straightforward to compare things. Resolves Issue 329.
This commit is contained in:
parent
1643427fa3
commit
f2e971b392
1 changed files with 4 additions and 2 deletions
|
|
@ -114,7 +114,8 @@ class Msg(SharedMemoryModel):
|
|||
#@property
|
||||
def __senders_get(self):
|
||||
"Getter. Allows for value = self.sender"
|
||||
return list(self.db_sender_players.all()) + list(self.db_sender_objects.all())
|
||||
return [hasattr(o, "typeclass") and o.typeclass or o for o in
|
||||
list(self.db_sender_players.all()) + list(self.db_sender_objects.all())]
|
||||
#@sender.setter
|
||||
def __senders_set(self, value):
|
||||
"Setter. Allows for self.sender = value"
|
||||
|
|
@ -160,7 +161,8 @@ class Msg(SharedMemoryModel):
|
|||
#@property
|
||||
def __receivers_get(self):
|
||||
"Getter. Allows for value = self.receivers. Returns three lists of receivers: players, objects and channels."
|
||||
return list(self.db_receivers_players.all()) + list(self.db_receivers_objects.all())
|
||||
return [hasattr(o, "typeclass") and o.typeclass or o for o in
|
||||
list(self.db_receivers_players.all()) + list(self.db_receivers_objects.all())]
|
||||
#@receivers.setter
|
||||
def __receivers_set(self, value):
|
||||
"Setter. Allows for self.receivers = value. This appends a new receiver to the message."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue