diff options
| author | Esau Rodriguez <esauro@gmail.com> | 2014-02-21 06:43:08 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-05-18 15:52:07 -0400 |
| commit | ec9043ab2f6027da709d1daf0df5599db6a77453 (patch) | |
| tree | 7e113d267b22c93959db9466cf9690431cc81a9f /django/core/serializers/python.py | |
| parent | 5a2556afb9b1b3ef6e0622552970c67ac84ecd28 (diff) | |
Fixed #21799 - Modified loaddata --ignorenonexistent to ignore models.
Diffstat (limited to 'django/core/serializers/python.py')
| -rw-r--r-- | django/core/serializers/python.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/django/core/serializers/python.py b/django/core/serializers/python.py index 249dc5a054..aa21598695 100644 --- a/django/core/serializers/python.py +++ b/django/core/serializers/python.py @@ -90,7 +90,13 @@ def Deserializer(object_list, **options): for d in object_list: # Look up the model and starting build a dict of data for it. - Model = _get_model(d["model"]) + try: + Model = _get_model(d["model"]) + except base.DeserializationError as e: + if ignore: + continue + else: + raise e data = {} if 'pk' in d: data[Model._meta.pk.attname] = Model._meta.pk.to_python(d.get("pk", None)) |
