Browse Source

Ajusta util de listagem de refs a model

pull/1751/merge
Marcio Mazza 7 years ago
parent
commit
4bd031f617
  1. 4
      sapl/legacy/scripts/utils.py

4
sapl/legacy/scripts/utils.py

@ -9,10 +9,10 @@ def getsourcelines(model):
for line in inspect.getsourcelines(model)[0]] for line in inspect.getsourcelines(model)[0]]
def get_models_com_referencia_a_autor(): def get_models_com_referencia_a(apontado):
def tem_referencia_a_autor(model): def tem_referencia_a_autor(model):
return any(getattr(field, 'related_model', None) == Autor return any(getattr(field, 'related_model', None) == apontado
for field in model._meta.get_fields()) for field in model._meta.get_fields())
return [model for app in appconfs for model in app.models.values() return [model for app in appconfs for model in app.models.values()

Loading…
Cancel
Save