Browse Source

Merge branch '320-mudar-exclusao-stubs' of https://github.com/interlegis/sapl into 320-mudar-exclusao-stubs

pull/329/head
Luciano Almeida 9 years ago
parent
commit
01e6400655
  1. 2
      base/admin.py
  2. 3
      base/models.py
  3. 2
      legacy/migration.py

2
base/admin.py

@ -2,6 +2,8 @@ from django.contrib import admin
from base.models import ProblemaMigracao
from sapl.utils import register_all_models_in_admin
from django.contrib import admin
from base.models import ProblemaMigracao
register_all_models_in_admin(__name__)

3
base/models.py

@ -2,7 +2,8 @@ from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from sapl.utils import UF

2
legacy/migration.py

@ -107,8 +107,6 @@ def get_fk_related(field, value, label=None):
field.name, value,
field.model.__name__, label or '---')
if value == 0:
# se FK == 0, criamos um stub e colocamos o valor '????????'
# para qualquer CharField ou TextField que possa haver
if not field.null:
fields_dict = get_fields_dict(field.related_model)
value = mommy.make(field.related_model,

Loading…
Cancel
Save