From cca497f2b81fa6d7d7797953afda2bcffea8e066 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 21 Aug 2017 22:49:29 +0200 Subject: Django 1.11: adapt all get_field_* to match the current Options API --- ishtar_common/views.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'ishtar_common/views.py') diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 0f1397758..8ab07fc00 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -72,7 +72,8 @@ from archaeological_finds.forms import DashboardTreatmentForm, \ from ishtar_common.forms import FinalForm, FinalDeleteForm from ishtar_common.widgets import JQueryAutoComplete -from ishtar_common.utils import get_random_item_image_link, shortify +from ishtar_common.utils import get_random_item_image_link, shortify, \ + get_all_field_names from ishtar_common import forms_common as forms from ishtar_common import wizards from ishtar_common.models import HistoryError, PRIVATE_FIELDS, \ @@ -677,8 +678,8 @@ def get_item(model, func_name, default_name, extra_request_keys=[], else: my_relation_types_prefix = copy(relation_types_prefix) - fields = [model._meta.get_field_by_name(k)[0] - for k in model._meta.get_all_field_names()] + fields = [model._meta.get_field(k) + for k in get_all_field_names(model)] request_keys = dict([ (field.name, field.name + (hasattr(field, 'rel') and field.rel and '__pk' @@ -690,8 +691,8 @@ def get_item(model, func_name, default_name, extra_request_keys=[], continue associated_model = globals()[associated_model] associated_fields = [ - associated_model._meta.get_field_by_name(k)[0] - for k in associated_model._meta.get_all_field_names()] + associated_model._meta.get_field(k) + for k in get_all_field_names(associated_model)] request_keys.update( dict([(key + "__" + field.name, key + "__" + field.name + -- cgit v1.2.3