summaryrefslogtreecommitdiff
path: root/django/core/serializers/python.py
AgeCommit message (Collapse)Author
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).
2017-06-05Refs #27795 -- Removed force_text() usage in serialization frameworkClaude Paroz
2017-04-27Refs #23919 -- Removed force_text() in Python deserializer needed only on ↵Claude Paroz
Python 2
2017-02-21Refs #27656 -- Updated django.core docstring verbs according to PEP 257.Anton Samarchyan
2017-02-01Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments.Vytis Banaitis
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.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-04-29Fixed #26207 -- Replaced dynamic classes with non-data descriptors for ↵Anssi Kääriäinen
deferred instance loading.
2016-04-08Fixed E128 flake8 warnings in django/.Tim Graham
2016-01-25Fixed #26125 -- Fixed E731 flake warnings.userimack
2015-10-23Cached model field_names in Python Deserializer.Andrey Kuzmin
2015-09-12Fixed #23395 -- Limited line lengths to 119 characters.Dražen Odobašić
2015-07-14Fixed #24716 -- Deprecated Field._get_val_from_obj()Thomas Stephenson
The method duplicates the functionality of Field.value_from_object() and has the additional downside of being a privately named public API method.
2015-07-02Fixed #25050 -- Allowed serialization of models with deferred fields.Grégoire ROCHER
2015-04-09Fixed #19820 -- Added more helpful error messages to Python deserializer.Richard Eames
2015-04-02Fixed #24558 -- Made dumpdata mapping ordering deterministic.Simon Charette
Thanks to gfairchild for the report and Claude for the review.
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-02-13Fixed #24320 - Used field.value_to_string() in serialization of foreign key.Andriy Sokolovskiy
This fixes serialization of a ForeignKey to a UUIDField as the test indicates.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-06Fixed #12663 -- Formalized the Model._meta API for retrieving fields.Daniel Pyrathon
Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
2014-12-23Fixed #17946 -- Fixed deserialization of self-referencing M2M fieldsClaude Paroz
Thanks Philip Mountifield for the report and excellent analysis, and Simon Charette for the review.
2014-09-05Limited lines to 119 characters in django/Tim Graham
refs #23395.
2014-05-18Removed some unnecessary exception naming; thanks claudep.Tim Graham
2014-05-18Fixed #21799 - Modified loaddata --ignorenonexistent to ignore models.Esau Rodriguez
2014-01-26Took advantage of the new get_model API. Refs #21702.Aymeric Augustin
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-28Changed get_model to raise an exception on errors.Aymeric Augustin
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.
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-02-12Fixed #19746 -- Allow deserialization of pk-less dataNick Sandford
2013-02-05Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`.Simon Charette
2012-09-30Fixed #9279 -- Added ignorenonexistent option to loaddataPreston Holmes
Thanks to Roman Gladkov for the initial patch and Simon Charette for review.
2012-08-08[py3] Fixed 'iterable but non string' detectionClaude Paroz
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.
2012-08-07[py3] Ported django.utils.encoding.Aymeric Augustin
* 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.
2012-08-07[py3] Fixed access to dict keys/values/items.Aymeric Augustin
2012-06-07Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
2012-05-26Fixed #5423 -- Made dumpdata output one row at a time.Claude Paroz
This should prevent storing all rows in memory when big sets of data are dumped. See ticket for heroic contributors.
2012-03-12Fix #17879: Corrected regression in python (inherited by yaml and json) ↵Karen Tracey
serializer that prevented serializing model instances with null FK ref to a model when serializing with natural keys. Thanks danfairs and tmitchell. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17685 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-04Fixed #17602 -- Stopped the XML serializer from doing unneeded queries. ↵Jannis Leidel
Thanks, gnosek. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17439 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-21Reverting r14994 (at request of SmileyChris) because of some backwards ↵Russell Keith-Magee
compatibility issues that need to be resolved. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14995 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-21Fixes #13252 -- Use the natural key instead of the primary key when serializingChris Beaven
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14994 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-18Fixed #13030 -- Corrected natural key deserialization to subclasses. Thanks ↵Russell Keith-Magee
to yishaibeeri for the report and test case. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12804 bcc190cf-cafb-0310-a4f2-bffc1f526a37