mirror of
https://github.com/evennia/evennia.git
synced 2026-03-21 07:16:31 +01:00
Cleanups and bug fixes. Fixed the @unlink command and also made it overally more stable. Resolves issue 161. Added more string conversion routines to handle non-ascii variables being stored in an Attribute. Resolves issue 160.
This commit is contained in:
parent
14db4bea4d
commit
7d30b337d9
27 changed files with 873 additions and 1048 deletions
|
|
@ -34,7 +34,7 @@ from django.contrib.contenttypes.models import ContentType
|
|||
from src.utils.idmapper.models import SharedMemoryModel
|
||||
from src.typeclasses import managers
|
||||
from src.locks.lockhandler import LockHandler
|
||||
from src.utils import logger
|
||||
from src.utils import logger, utils
|
||||
from src.utils.utils import is_iter, has_parent
|
||||
|
||||
PERMISSION_HIERARCHY = [p.lower() for p in settings.PERMISSION_HIERARCHY]
|
||||
|
|
@ -187,13 +187,13 @@ class Attribute(SharedMemoryModel):
|
|||
Getter. Allows for value = self.value.
|
||||
"""
|
||||
try:
|
||||
return self.validate_data(pickle.loads(str(self.db_value)))
|
||||
return utils.to_unicode(self.validate_data(pickle.loads(utils.to_str(self.db_value))))
|
||||
except pickle.UnpicklingError:
|
||||
return self.db_value
|
||||
#@value.setter
|
||||
def value_set(self, new_value):
|
||||
"Setter. Allows for self.value = value"
|
||||
self.db_value = pickle.dumps(self.validate_data(new_value))
|
||||
self.db_value = utils.to_unicode(pickle.dumps(utils.to_str(self.validate_data(new_value))))
|
||||
self.save()
|
||||
#@value.deleter
|
||||
def value_del(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue