summaryrefslogtreecommitdiff
path: root/django/core/serializers/base.py
AgeCommit message (Collapse)Author
2025-12-17Fixed #27380 -- Added "raw" argument to m2m_changed signals.Mariusz Felisiak
2025-12-03Fixed #35729 -- Enabled natural key serialization opt-out for subclasses.rimi0108
Refactored serialization logic to allow models inheriting a natural_key() method (e.g. AbstractBaseUser) to explicitly opt out of natural key serialization by returning an empty tuple from the method. Thanks Jonas Dittrich for the report. Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2023-01-17Refs #29708 -- Removed PickleSerializer per deprecation timeline.Mariusz Felisiak
2022-03-18Fixed #33582 -- Fixed deserializing natural keys with foreing key ↵François Granade
dependencies in a multiple database setup.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-01-13Fixed #29708 -- Deprecated PickleSerializer.Adam Johnson
2021-09-02Refs #33012 -- Moved PickleSerializer to django.core.serializers.base and ↵Daniyal Abbasi
added tests.
2021-02-05Fixed #32420 -- Fixed detecting primary key values in deserialization when ↵Mikolaj Rybinski
PK is also a FK.
2019-12-13Fixed #26743 -- Fixed UnboundLocalError crash when deserializing m2m fields ↵Baptiste Mispelon
and value isn't iterable.
2019-06-27Fixed #28725 -- Prevented serializing inherited ManyToManyFields in child model.Nadège Michel
2019-04-18Fixed typos in docs, comments, and exception messages.Ville Skyttä
2018-11-27Fixed #28385 -- Fixed deserializing natural keys when primary key has a ↵dmytryi.striletskyi
default value. Co-Authored-By: Hasan Ramezani <hasan.r67@gmail.com>
2018-08-01Fixed typos in comments and docs.luz.paz
2018-07-13Fixed #26291 -- Allowed loaddata to handle forward references in natural_key ↵Peter Inglesby
fixtures.
2018-03-20Extracted deserialize fk/m2m functions from Deserializer.Peter Inglesby
In preparation for handling forward references (refs #26291).
2018-02-12Fixed #24607 -- Serialized natural keys in multi-table inheritance models.Denys Duchier
Thanks João Paulo Melo de Sampaio for the test.
2018-01-03Fixed #28982 -- Simplified code with and/or.Дилян Палаузов
2017-02-11Fixed #27742 -- Reverted "Fixed #24607 -- Serialized natural keys in ↵Tim Graham
multi-table inheritance models." This reverts commit 74a575eb7296fb04e1fc2bd4e3f68dee3c66ee0a as it causes unexpected migrations and doesn't seem to be the best solution.
2017-02-01Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments.Vytis Banaitis
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2016-12-01Fixed #27546 -- Removed hardcoded class names in __repr__() methods.Keda87
2016-10-12Fixed #24607 -- Serialized natural keys in multi-table inheritance models.João Sampaio
2016-06-08Fixed #26717 -- Added Serializer.stream_class to customize the stream.Berker Peksag
2016-05-02Fixed docstring typos.Offby-One Kenobi
2015-10-27Fixed #25550 -- Deprecated direct assignment to the reverse side of a ↵Tim Graham
related set.
2015-07-24Fixed #22258 -- Added progress status for dumpdata when outputting to fileClaude Paroz
Thanks Gwildor Sok for the report and Tim Graham for the review.
2015-06-10Fix for ticket 12685mick
2015-05-02Fixed #24693 -- Added label and label_lower property to Model._metaLuis Del Giudice
2015-04-09Fixed #19820 -- Added more helpful error messages to Python deserializer.Richard Eames
2015-03-25Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen
Field.rel is now deprecated. Rel objects have now also remote_field attribute. This means that self == self.remote_field.remote_field. In addition, made the Rel objects a bit more like Field objects. Still, marked ManyToManyFields as null=True.
2015-01-17Removed dumpdata --natural option and serializers use_natural_keys parameter.Tim Graham
Per deprecation timeline; refs #13252.
2014-03-08Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
2013-12-30Stopped populating the app registry as a side effect.Aymeric Augustin
Since it triggers imports, it shouldn't be done lightly. This commit adds a public API for doing it explicitly, django.setup(), and does it automatically when using manage.py and wsgi.py.
2013-12-24Renamed AppCache to Apps.Aymeric Augustin
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-22Terminated AppCache._populate() with extreme prejudice.Aymeric Augustin
It was called _populate() before I renamed it to populate(). Since it has been superseded by populate_models() there's no reason to keep it. Removed the can_postpone argument of load_app() as it was only used by populate(). It's a private API and there's no replacement. Simplified load_app() accordingly. Then new version behaves exactly like the old one even though it's much shorter.
2013-12-17Moved the new app cache inside core.Aymeric Augustin
2013-12-17Removed the _-prefix for populate().Aymeric Augustin
Several parts of Django call get_apps() with a comment along this lines of "this has the side effect of calling _populate()". I fail to see how this is better than just calling populate()!
2013-12-17Removed module-level functions for the app cache.Aymeric Augustin
Since the original ones in django.db.models.loading were kept only for backwards compatibility, there's no need to recreate them. However, many internals of Django still relied on them. They were also imported in django.db.models. They never appear in the documentation, except a quick mention of get_models and get_app in the 1.2 release notes to document an edge case in GIS. I don't think that makes them a public API. This commit doesn't change the overall amount of global state but clarifies that it's tied to the app_cache object instead of hiding it behind half a dozen functions.
2013-11-02More attacking E302 violatorsAlex Gaynor
2013-10-11Fixed #13252 -- Added ability to serialize with natural primary keys.Tai Lee
Added ``--natural-foreign`` and ``--natural-primary`` options and deprecated the ``--natural`` option to the ``dumpdata`` management command. Added ``use_natural_foreign_keys`` and ``use_natural_primary_keys`` arguments and deprecated the ``use_natural_keys`` argument to ``django.core.serializers.Serializer.serialize()``. Thanks SmileyChris for the suggestion.
2013-09-10Fixed #20841 -- Added messages to NotImplementedErrorsGregor MacGregor
Thanks joseph at vertstudios.com for the suggestion.
2013-06-19Removed several unused imports.Aymeric Augustin
2013-05-11Fixed #20136 - Fixed and expanded the docs for loaddata and model signals.Tim Graham
Thanks brandon@ and Anssi for the report.
2012-11-03Fixed #18963 -- Used a subclass-friendly patternAymeric Augustin
for Python 2 object model compatibility methods.
2012-08-14[py3] Fixed serializers testsClaude Paroz