mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Fix ServerConfig model for Py3.
This commit is contained in:
parent
9d48e616b1
commit
b5cf27fc18
1 changed files with 3 additions and 8 deletions
|
|
@ -8,12 +8,7 @@ Config values should usually be set through the
|
|||
manager's conf() method.
|
||||
|
||||
"""
|
||||
from builtins import object
|
||||
|
||||
try:
|
||||
import pickle as pickle
|
||||
except ImportError:
|
||||
import pickle
|
||||
import pickle
|
||||
|
||||
from django.db import models
|
||||
from evennia.utils.idmapper.models import WeakSharedMemoryModel
|
||||
|
|
@ -48,7 +43,7 @@ class ServerConfig(WeakSharedMemoryModel):
|
|||
# main name of the database entry
|
||||
db_key = models.CharField(max_length=64, unique=True)
|
||||
# config value
|
||||
db_value = models.TextField(blank=True)
|
||||
db_value = models.BinaryField(blank=True)
|
||||
|
||||
objects = ServerConfigManager()
|
||||
_is_deleted = False
|
||||
|
|
@ -83,7 +78,7 @@ class ServerConfig(WeakSharedMemoryModel):
|
|||
#@property
|
||||
def __value_get(self):
|
||||
"Getter. Allows for value = self.value"
|
||||
return pickle.loads(str(self.db_value))
|
||||
return pickle.loads(self.db_value)
|
||||
|
||||
#@value.setter
|
||||
def __value_set(self, value):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue