diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-08-21 22:49:29 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-08-21 22:49:29 +0200 |
commit | a6aa949e1e74c9edd81b275d61e1f354b5c39ba5 (patch) | |
tree | b58ea191ef3cb985ed7d1c75ad60273128652638 /ishtar_common/wizards.py | |
parent | c0eb7726323ec0cf710a5d4b2761d80849184953 (diff) | |
download | Ishtar-a6aa949e1e74c9edd81b275d61e1f354b5c39ba5.tar.bz2 Ishtar-a6aa949e1e74c9edd81b275d61e1f354b5c39ba5.zip |
Django 1.11: adapt all get_field_* to match the current Options API
Diffstat (limited to 'ishtar_common/wizards.py')
-rw-r--r-- | ishtar_common/wizards.py | 8 |
1 files changed, 5 insertions, 3 deletions
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 \ |