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:
Griatch 2012-12-08 20:45:52 +01:00
parent 1643427fa3
commit f2e971b392

View file

@ -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."