From 47b79808cc55d8602ffeae963571583906b2fd10 Mon Sep 17 00:00:00 2001 From: Phil Krylov Date: Tue, 24 Jul 2018 17:07:34 +0300 Subject: [PATCH] Fixed Python 3 / Django 2 compatibility in generated models code --- xsd_to_django_model/xsd_to_django_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xsd_to_django_model/xsd_to_django_model.py b/xsd_to_django_model/xsd_to_django_model.py index a4cf5be..d16a665 100755 --- a/xsd_to_django_model/xsd_to_django_model.py +++ b/xsd_to_django_model/xsd_to_django_model.py @@ -471,9 +471,9 @@ def build_code(self): if option.startswith('abstract = ')): meta.append('abstract = True') indexes = \ - ['GinIndex(["%s"])' % f + ['GinIndex(fields=["%s"])' % f for f in model_options.get('gin_index_fields', [])] + \ - ['models.Index(["%s"])' % f + ['models.Index(fields=["%s"])' % f for f in list(set(model_options.get('plain_index_fields', [])) - set(model_options.get('unique_fields', []))) if f != model_options.get('primary_key')]