We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bece6e commit ff7ea9aCopy full SHA for ff7ea9a
psqlextra/backend/migrations/state/model.py
@@ -1,3 +1,4 @@
1
+from collections.abc import Mapping
2
from typing import Type
3
4
from django.db.migrations.state import ModelState
@@ -68,7 +69,15 @@ def render(self, apps):
68
69
"Cannot resolve one or more bases from %r" % (self.bases,)
70
)
71
- fields = {name: field.clone() for name, field in self.fields}
72
+ if isinstance(self.fields, Mapping):
73
+ # In Django 3.1 `self.fields` became a `dict`
74
+ fields = {
75
+ name: field.clone() for name, field in self.fields.items()
76
+ }
77
+ else:
78
+ # In Django < 3.1 `self.fields` is a list of (name, field) tuples
79
+ fields = {name: field.clone() for name, field in self.fields}
80
+
81
meta = type(
82
"Meta",
83
(),
0 commit comments