Skip to content

Commit

Permalink
Fixed Python 3 / Django 2 compatibility in generated models code
Browse files Browse the repository at this point in the history
  • Loading branch information
tuffnatty committed Jul 24, 2018
1 parent bae8a27 commit 47b7980
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xsd_to_django_model/xsd_to_django_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')]
Expand Down

0 comments on commit 47b7980

Please sign in to comment.