Migrations work under sqlite3, both from latest dev, from new install and from trunk. There might be some consistency issues though (it seems the character list is not properly migrated), so more testing is required.

This commit is contained in:
Griatch 2013-04-13 23:50:33 +02:00
parent 8bd8193ab9
commit 230d73cfa0
16 changed files with 2941 additions and 463 deletions

View file

@ -9,7 +9,7 @@ try:
except ImportError:
import pickle
from src.utils.utils import to_str, to_unicode
from src.typeclasses.models import PackedDBobject
#from src.typeclasses.models import PackedDBobject
from django.contrib.contenttypes.models import ContentType
CTYPEGET = ContentType.objects.get
@ -17,6 +17,37 @@ GA = object.__getattribute__
SA = object.__setattr__
DA = object.__delattr__
class PackedDBobject(object):
"""
Attribute helper class.
A container for storing and easily identifying database objects in
the database (which doesn't suppport storing db_objects directly).
"""
def __init__(self, ID, db_model, db_key):
self.id = ID
self.db_model = db_model
self.key = db_key
def __str__(self):
return "%s(#%s)" % (self.key, self.id)
def __unicode__(self):
return u"%s(#%s)" % (self.key, self.id)
class PackedDBobject(object):
"""
Attribute helper class.
A container for storing and easily identifying database objects in
the database (which doesn't suppport storing db_objects directly).
"""
def __init__(self, ID, db_model, db_key):
self.id = ID
self.db_model = db_model
self.key = db_key
def __str__(self):
return "%s(#%s)" % (self.key, self.id)
def __unicode__(self):
return u"%s(#%s)" % (self.key, self.id)
class PackedDict(dict):
"""
Attribute helper class.