Fixed a bug in comms' typeclass->dbobj conversion
This commit is contained in:
parent
2d75648eb1
commit
a4a50fdb87
2 changed files with 3 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ from django.db import models
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
|
||||||
|
_GA = object.__getattribute__
|
||||||
_PlayerDB = None
|
_PlayerDB = None
|
||||||
_ObjectDB = None
|
_ObjectDB = None
|
||||||
_Channel = None
|
_Channel = None
|
||||||
|
|
@ -58,7 +59,7 @@ def identify_object(inp):
|
||||||
return inp, None
|
return inp, None
|
||||||
# try to identify the type
|
# try to identify the type
|
||||||
try:
|
try:
|
||||||
obj = inp.dbobj # this works for all typeclassed entities
|
obj = _GA(inp, "dbobj") # this works for all typeclassed entities
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
obj = inp
|
obj = inp
|
||||||
typ = type(obj)
|
typ = type(obj)
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ from src.utils.utils import is_iter, to_str, crop, make_iter
|
||||||
|
|
||||||
__all__ = ("Msg", "TempMsg", "Channel", "PlayerChannelConnection", "ExternalChannelConnection")
|
__all__ = ("Msg", "TempMsg", "Channel", "PlayerChannelConnection", "ExternalChannelConnection")
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Msg
|
# Msg
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue