diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2009-12-14 12:39:20 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2009-12-14 12:39:20 +0000 |
| commit | 35cc439228cd32dfa7a3ec919db01a8a5cd17d33 (patch) | |
| tree | ed9aff433487895c0e649994450fd0accb6362d2 /django/core/serializers/pyyaml.py | |
| parent | 44b9076bbed3e629230d9b77a8765e4c906036d1 (diff) | |
Fixed #7052 -- Added support for natural keys in serialization.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11863 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/serializers/pyyaml.py')
| -rw-r--r-- | django/core/serializers/pyyaml.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/django/core/serializers/pyyaml.py b/django/core/serializers/pyyaml.py index 34f8118d38..7a302e615e 100644 --- a/django/core/serializers/pyyaml.py +++ b/django/core/serializers/pyyaml.py @@ -26,9 +26,9 @@ class Serializer(PythonSerializer): """ Convert a queryset to YAML. """ - + internal_use_only = False - + def handle_field(self, obj, field): # A nasty special case: base YAML doesn't support serialization of time # types (as opposed to dates or datetimes, which it does support). Since @@ -40,10 +40,11 @@ class Serializer(PythonSerializer): self._current[field.name] = str(getattr(obj, field.name)) else: super(Serializer, self).handle_field(obj, field) - + def end_serialization(self): self.options.pop('stream', None) self.options.pop('fields', None) + self.options.pop('use_natural_keys', None) yaml.dump(self.objects, self.stream, Dumper=DjangoSafeDumper, **self.options) def getvalue(self): |
