summaryrefslogtreecommitdiff
path: root/django/core/serializers/python.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-011-2/+1
| | | | | | | | Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
* Fixed #33937 -- Optimized serialization of related m2m fields without ↵Mark Evans2022-09-051-1/+7
| | | | natural keys.
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-19/+47
|
* Fixed #29078 -- Made serializers respect prefetch_related() for m2m fields.Claude Paroz2020-05-251-3/+5
|
* Fixed #30159 -- Removed unneeded use of OrderedDict.Nick Pope2019-02-061-3/+2
| | | | Dicts preserve order since Python 3.6.
* Fixed #26291 -- Allowed loaddata to handle forward references in natural_key ↵Peter Inglesby2018-07-131-5/+13
| | | | fixtures.
* Extracted deserialize fk/m2m functions from Deserializer.Peter Inglesby2018-03-201-40/+9
| | | In preparation for handling forward references (refs #26291).
* Refs #27795 -- Removed force_text() usage in serialization frameworkClaude Paroz2017-06-051-14/+12
|
* Refs #23919 -- Removed force_text() in Python deserializer needed only on ↵Claude Paroz2017-04-271-6/+0
| | | | Python 2
* Refs #27656 -- Updated django.core docstring verbs according to PEP 257.Anton Samarchyan2017-02-211-4/+2
|
* Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments.Vytis Banaitis2017-02-011-8/+6
|
* Refs #23919 -- Removed most of remaining six usageClaude Paroz2017-01-181-2/+1
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed six.<various>_types usageClaude Paroz2017-01-181-2/+2
| | | | Thanks Tim Graham and Simon Charette for the reviews.
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-2/+0
|
* Fixed #26207 -- Replaced dynamic classes with non-data descriptors for ↵Anssi Kääriäinen2016-04-291-2/+1
| | | | deferred instance loading.
* Fixed E128 flake8 warnings in django/.Tim Graham2016-04-081-2/+3
|
* Fixed #26125 -- Fixed E731 flake warnings.userimack2016-01-251-3/+6
|
* Cached model field_names in Python Deserializer.Andrey Kuzmin2015-10-231-1/+5
|
* Fixed #23395 -- Limited line lengths to 119 characters.Dražen Odobašić2015-09-121-9/+13
|
* Fixed #24716 -- Deprecated Field._get_val_from_obj()Thomas Stephenson2015-07-141-1/+1
| | | | | | The method duplicates the functionality of Field.value_from_object() and has the additional downside of being a privately named public API method.
* Fixed #25050 -- Allowed serialization of models with deferred fields.Grégoire ROCHER2015-07-021-1/+2
|
* Fixed #19820 -- Added more helpful error messages to Python deserializer.Richard Eames2015-04-091-15/+30
|
* Fixed #24558 -- Made dumpdata mapping ordering deterministic.Simon Charette2015-04-021-6/+5
| | | | Thanks to gfairchild for the report and Claude for the review.
* Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen2015-03-251-15/+15
| | | | | | | | 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.
* Fixed #24320 - Used field.value_to_string() in serialization of foreign key.Andriy Sokolovskiy2015-02-131-0/+2
| | | | | This fixes serialization of a ForeignKey to a UUIDField as the test indicates.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-1/+1
|
* Fixed #12663 -- Formalized the Model._meta API for retrieving fields.Daniel Pyrathon2015-01-061-3/+3
| | | | | Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
* Fixed #17946 -- Fixed deserialization of self-referencing M2M fieldsClaude Paroz2014-12-231-7/+7
| | | | | Thanks Philip Mountifield for the report and excellent analysis, and Simon Charette for the review.
* Limited lines to 119 characters in django/Tim Graham2014-09-051-1/+3
| | | | refs #23395.
* Removed some unnecessary exception naming; thanks claudep.Tim Graham2014-05-181-2/+2
|
* Fixed #21799 - Modified loaddata --ignorenonexistent to ignore models.Esau Rodriguez2014-05-181-1/+7
|
* Took advantage of the new get_model API. Refs #21702.Aymeric Augustin2014-01-261-2/+1
|
* Stopped populating the app registry as a side effect.Aymeric Augustin2013-12-301-2/+0
| | | | | | | 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.
* Changed get_model to raise an exception on errors.Aymeric Augustin2013-12-281-3/+1
| | | | | | | | | | | | Returning None on errors required unpythonic error checking and was inconsistent with get_app_config. get_model was a private API until the previous commit, but given that it was certainly used in third party software, the change is explained in the release notes. Applied the same change to get_registered_model, which is a new private API introduced during the recent refactoring.
* Renamed AppCache to Apps.Aymeric Augustin2013-12-241-3/+3
| | | | | | Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
* Moved apps back in the toplevel django namespace.Aymeric Augustin2013-12-221-1/+1
| | | | Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
* Terminated AppCache._populate() with extreme prejudice.Aymeric Augustin2013-12-221-1/+1
| | | | | | | | | | 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.
* Moved the new app cache inside core.Aymeric Augustin2013-12-171-1/+1
|
* Removed the _-prefix for populate().Aymeric Augustin2013-12-171-1/+2
| | | | | | 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()!
* Removed module-level functions for the app cache.Aymeric Augustin2013-12-171-2/+3
| | | | | | | | | | | | | | | 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.
* More attacking E302 violatorsAlex Gaynor2013-11-021-0/+1
|
* Fixed #13252 -- Added ability to serialize with natural primary keys.Tai Lee2013-10-111-7/+13
| | | | | | | | | | | | 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.
* Fixed #19746 -- Allow deserialization of pk-less dataNick Sandford2013-02-121-1/+1
|
* Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`.Simon Charette2013-02-051-1/+1
|
* Fixed #9279 -- Added ignorenonexistent option to loaddataPreston Holmes2012-09-301-1/+11
| | | Thanks to Roman Gladkov for the initial patch and Simon Charette for review.
* [py3] Fixed 'iterable but non string' detectionClaude Paroz2012-08-081-2/+2
| | | | | | In Python 3, the str type has an __iter__ attribute. Therefore, the presence of an __iter__ attribute is not sufficient to distinguish 'standard' iterables (list, tuple) from strings.
* [py3] Ported django.utils.encoding.Aymeric Augustin2012-08-071-7/+7
| | | | | | | | | | | * Renamed smart_unicode to smart_text (but kept the old name under Python 2 for backwards compatibility). * Renamed smart_str to smart_bytes. * Re-introduced smart_str as an alias for smart_text under Python 3 and smart_bytes under Python 2 (which is backwards compatible). Thus smart_str always returns a str objects. * Used the new smart_str in a few places where both Python 2 and 3 want a str.
* [py3] Fixed access to dict keys/values/items.Aymeric Augustin2012-08-071-1/+2
|
* Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz2012-06-071-1/+2
| | | | | Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
* Fixed #5423 -- Made dumpdata output one row at a time.Claude Paroz2012-05-261-5/+8
| | | | | | This should prevent storing all rows in memory when big sets of data are dumped. See ticket for heroic contributors.