Browse Source

Add todo comment

pull/6/head
Marcio Mazza 10 years ago
parent
commit
8c352d9a15
  1. 3
      legacy/scripts/migrate.py

3
legacy/scripts/migrate.py

@ -74,6 +74,9 @@ def migrate():
value = getattr(old, old_field)
# check for a relation
model_field = model._meta.get_field(new_field)
# TODO ... test for special transformations first (e.g. Parlamentar.localidade_residencia)
# elfi ...
if isinstance(model_field, models.ForeignKey):
value = model_field.related_model.objects.get(id=value)
setattr(new, new_field, value)

Loading…
Cancel
Save