From a6aa949e1e74c9edd81b275d61e1f354b5c39ba5 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/wizards.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ishtar_common/wizards.py') diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index a82b68d5b..5217eafae 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -40,7 +40,9 @@ from django.shortcuts import render_to_response, redirect from django.template import Context, RequestContext, loader from django.utils.datastructures import MultiValueDict as BaseMultiValueDict from django.utils.translation import ugettext_lazy as _ -import models + +from ishtar_common import models +from ishtar_common.utils import get_all_field_names logger = logging.getLogger(__name__) @@ -528,7 +530,7 @@ class Wizard(NamedUrlWizardView): for k in dct: if k.startswith('pk'): continue - if k not in obj.__class__._meta.get_all_field_names(): + if k not in get_all_field_names(obj.__class__): continue # False set to None for images and files if not k.endswith('_id') and ( @@ -608,7 +610,7 @@ class Wizard(NamedUrlWizardView): if 'pk' in dct: dct.pop('pk') # remove non relevant fields - all_field_names = self.get_saved_model()._meta.get_all_field_names() + all_field_names = get_all_field_names(self.get_saved_model()) for k in dct.copy(): if not (k.endswith('_id') and k[:-3] in all_field_names) \ and k not in all_field_names and \ -- cgit v1.2.3