Fixed remaining issues with migrating the attribute changes.
This commit is contained in:
parent
230d73cfa0
commit
82c2e19ed5
2 changed files with 20 additions and 16 deletions
|
|
@ -270,7 +270,9 @@ class PackedSet(set):
|
||||||
|
|
||||||
|
|
||||||
class Migration(DataMigration):
|
class Migration(DataMigration):
|
||||||
|
depends_on = (
|
||||||
|
("objects", "0018_add_picklefield"),
|
||||||
|
)
|
||||||
def forwards(self, orm):
|
def forwards(self, orm):
|
||||||
"Write your forwards methods here."
|
"Write your forwards methods here."
|
||||||
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
|
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
|
||||||
|
|
@ -298,8 +300,7 @@ class Migration(DataMigration):
|
||||||
"""
|
"""
|
||||||
Convert db-stored dbref back to object
|
Convert db-stored dbref back to object
|
||||||
"""
|
"""
|
||||||
mclass = orm[data.db_model].model_class()
|
mclass = CTYPEGET(model=data.db_model).model_class()
|
||||||
#mclass = CTYPEGET(model=data.db_model).model_class()
|
|
||||||
try:
|
try:
|
||||||
return mclass.objects.get(id=data.id)
|
return mclass.objects.get(id=data.id)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -334,6 +334,10 @@ def to_attr(data):
|
||||||
|
|
||||||
class Migration(DataMigration):
|
class Migration(DataMigration):
|
||||||
|
|
||||||
|
depends_on = (
|
||||||
|
("objects", "0018_add_picklefield"),
|
||||||
|
)
|
||||||
|
|
||||||
def forwards(self, orm):
|
def forwards(self, orm):
|
||||||
"Write your forwards methods here."
|
"Write your forwards methods here."
|
||||||
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
|
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
|
||||||
|
|
@ -361,8 +365,7 @@ class Migration(DataMigration):
|
||||||
"""
|
"""
|
||||||
Convert db-stored dbref back to object
|
Convert db-stored dbref back to object
|
||||||
"""
|
"""
|
||||||
mclass = orm[data.db_model].model_class()
|
mclass = CTYPEGET(model=data.db_model).model_class()
|
||||||
#mclass = CTYPEGET(model=data.db_model).model_class()
|
|
||||||
try:
|
try:
|
||||||
return mclass.objects.get(id=data.id)
|
return mclass.objects.get(id=data.id)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue