toastdriven/django-tastypie — pull request #833 by acdha (2013-02-22 22:28:01+00:00)
Title: Make default serialization formats use a Django setting

While it's possible to configure or subclass Serializer to accomplish the same
goal (or will be when #817 lands) that requires repetitive code changes for a
simple site policy like 'We only support JSON and XML', which can now be as
simple as adding a setting::

TASTYPIE_DEFAULT_FORMATS = ['json', 'xml']

Changes:
* Serializer: __init__ will apply TASTYPIE_DEFAULT_FORMATS when
self.formats is the default Serializer.formats
* Serializer: restructured __init__ to improve locality for format-
related settings
* Restructured serializers documentation so format-related info is
in one place & added a link to the new setting doc for
TASTYPIE_DEFAULT_FORMATS