summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/db/models/base.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index 7c7bd2d7ee..97d1eecbc8 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -727,7 +727,7 @@ class Model(metaclass=ModelBase):
update_fields = frozenset(update_fields)
field_names = set()
- for field in self._meta.fields:
+ for field in self._meta.concrete_fields:
if not field.primary_key:
field_names.add(field.name)
@@ -737,9 +737,11 @@ class Model(metaclass=ModelBase):
non_model_fields = update_fields.difference(field_names)
if non_model_fields:
- raise ValueError("The following fields do not exist in this "
- "model or are m2m fields: %s"
- % ', '.join(non_model_fields))
+ raise ValueError(
+ 'The following fields do not exist in this model, are m2m '
+ 'fields, or are non-concrete fields: %s'
+ % ', '.join(non_model_fields)
+ )
# If saving to the same database, and this model is deferred, then
# automatically do an "update_fields" save on the loaded fields.