summaryrefslogtreecommitdiff
path: root/django/core/serializers/pyyaml.py
AgeCommit message (Collapse)Author
2026-04-19Removed OrderedDict representer from PyYAML serializer.Tim Graham
Added in 5bc3123479bd97dc9d8a36fa9a3421a71063d1da (refs #24558), it was obsoleted when OrderedDict usage was removed in 24b82cd201e21060fbc02117dc16d1702877a1f3 (refs #30159).
2026-04-19Refs #36986 -- Replaced yaml's Serializer._value_from_field() time handling ↵Tim Graham
with a representer.
2026-04-19Replaced yaml serializer workaround to preserve dict order with PyYAML's ↵Tim Graham
sort_keys=False. The sort_keys parameter was added in PyYAML 5.1 (released March 2019). The workaround was added in 24b82cd201e21060fbc02117dc16d1702877a1f3 (refs #30159).
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-11-12Refs #21286 -- Fixed YAML serialization of TimeField primary key.Adam Zapletal
Handling for PyYAML not being able to serialize `datetime.time` values is moved from `handle_field` to `_value_from_field` as only non-primary key, non-relation fields are passed into `handle_field`.
2024-09-17Fixed #29522 -- Refactored the Deserializer functions to classes.Amir Karimi
Co-authored-by: Emad Mokhtar <emad.mokhtar@veneficus.nl>
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2020-07-30Bumped minimum isort version to 5.1.0.David Smith
Fixed inner imports per isort 5. isort 5.0.0 to 5.1.0 was unstable.
2020-04-28Fixed #29249 -- Made JSON and YAML serializers use Unicode by default.Hasan Ramezani
2019-02-06Fixed #30159 -- Removed unneeded use of OrderedDict.Nick Pope
Dicts preserve order since Python 3.6.
2018-09-26Refs #29784 -- Switched to https:// links where available.Jon Dufresne
2017-02-23Refs #23919 -- Used yield from.Vytis Banaitis
2017-02-21Refs #27656 -- Updated django.core docstring verbs according to PEP 257.Anton Samarchyan
2017-02-09Refs #23919 -- Removed default 'utf-8' argument for str.encode()/decode().Tim Graham
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-22Refs #23919 -- Replaced six.reraise by raiseClaude Paroz
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2016-11-14Fixed E305 flake8 warnings.Ramin Farajpour Cami
2015-04-02Fixed #24558 -- Made dumpdata mapping ordering deterministic.Simon Charette
Thanks to gfairchild for the report and Claude for the review.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2013-11-02More attacking E302 violatorsAlex Gaynor
2013-03-19Fixed #18003 -- Preserved tracebacks when re-raising errors.konarkmodi
Thanks jrothenbuhler for draft patch, Konark Modi for updates.
2013-01-05Fixed #12914 -- Use yaml faster C implementation when availableClaude Paroz
Thanks Beuc for the report and the initial patch.
2012-08-29Replaced many smart_bytes by force_bytesClaude Paroz
In all those occurrences, we didn't care about preserving the lazy status of the strings, but we really wanted to obtain a real bytestring.
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-07-22[py3] Replaced basestring by six.string_types.Aymeric Augustin
2012-06-28Fixed #15197 -- Fixed yaml serialization into HttpResponseClaude Paroz
Thanks fourga38 for the report and hirokiky at gmail.com for the initial patch.
2012-06-15Favored text (StringIO) over binary content for deserializationClaude Paroz
This is also more Python 3 compatible, as the json module in Python 3 is expecting text. Thanks Vinay Sajip for noticing it.
2012-06-10Fixed #18457 -- Fixed encoding error in yaml deserializerClaude Paroz
Thanks jpaugh64 for the report.
2012-05-05Replaced cStringIO.StringIO by io.BytesIO.Claude Paroz
Also replaced StringIO.StringIO by BytesIO in some other appropriate places. StringIO is not available in Python 3.
2012-04-29Fixed #18013 -- Use the new 'as' syntax for exceptions.Claude Paroz
Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
2012-02-10Fixed the exception handling when deserializing via generators on Python 2.5 ↵Jannis Leidel
that was introduced in r17469. Also only test the YAML serializer if PyYAML is installed. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17487 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-09Fixed #11970 -- Wrapped the exception happening during deserialization in ↵Jannis Leidel
DeserializationError exceptions. Thanks, Claude Paroz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17469 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-01Used yaml.safe_load instead of yaml.load, because safety should be the default.Aymeric Augustin
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17062 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-08Fixed #14888 -- Removing duplicated code in serialisers. Thanks to eric.fortin.Andrew Godwin
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15163 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22Fixed #1142 -- Added multiple database support.Russell Keith-Magee
This monster of a patch is the result of Alex Gaynor's 2009 Google Summer of Code project. Congratulations to Alex for a job well done. Big thanks also go to: * Justin Bronn for keeping GIS in line with the changes, * Karen Tracey and Jani Tiainen for their help testing Oracle support * Brett Hoerner, Jon Loyens, and Craig Kimmerer for their feedback. * Malcolm Treddinick for his guidance during the GSoC submission process. * Simon Willison for driving the original design process * Cal Henderson for complaining about ponies he wanted. ... and everyone else too numerous to mention that helped to bring this feature into fruition. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-14Fixed #7052 -- Added support for natural keys in serialization.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11863 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-12Fixed #10240 -- Restored YAML serialization with Decimal objects that broke ↵Brian Rosner
with r9823. Thanks Alex Gaynor for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9825 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-30Fixed #7990 -- Modified serializers to use StringIO, rather than cStringIO, ↵Russell Keith-Magee
due to potential unicode issues. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8151 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-19Fixed #6481 -- Fixed a bunch of import problems (and some whitespace cleanups).Malcolm Tredinnick
Found by Bastian Kleineidam with help from pyflakes. Thanks. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7131 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-17Fixed #6110 -- Mark the python format serializer as for internal use only. ↵Malcolm Tredinnick
Thanks, empty. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-04Fixed a bug introduced in [6891]: the "safe" YAML serializer can't handle ↵Jacob Kaplan-Moss
time types out of the box. I've worked around the bug by coercing times to strings, which is far from perfect. However, it's better than a Python-specific "!!python/time" type which would break interoperability (which was the goal of switching to the safe mode in the first place). git-svn-id: http://code.djangoproject.com/svn/django/trunk@6893 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-04Fixed #5268: the YAML serializer now uses yaml.safe_dump() instead the plain ↵Jacob Kaplan-Moss
yaml.dump(); this makes YAML dumps more portable, and also removes the crufty '!!python/unicode' business. Thanks, poelzi. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6891 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04Merged Unicode branch into trunk (r4952:5608). This should be fullyMalcolm Tredinnick
backwards compatible for all practical purposes. Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-01Fixed #3466 -- Fixed problem with specifyin a 'fields' argument to a JSON ↵Russell Keith-Magee
serializer. Also added documenation for the 'fields' argument. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5409 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-15Fixed typo in docstring of YAML serializer.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4734 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-12Added a YAML serializer built on PyYAML (http://pyyaml.org/). This ↵Jacob Kaplan-Moss
serializer will only be enabled if PyYAML is installed, so I've not written any unit tests until I figure out how to make them work similarly. Still, the serializer is just a thin layer over the base Python serializer, and seems to Just Work. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4712 bcc190cf-cafb-0310-a4f2-bffc1f526a37