Commit graph

20 commits

Author SHA1 Message Date
Dave Shawley
242a0590e6 Prevent meta-class error in top-level imports.
Extended the `ImportError` handling hack to correctly handle the
case where we cannot import submodules AND someone is extending
one of the exported classes.  Previously ContentMixin and
ContentSettings were functions when ImportError was raised which
causes really confusing errors.

The correct solution here is to stop exporting stuff at the top-
level and require clients to import from modules but that is for
another day.
2016-03-16 09:19:04 -04:00
Dave Shawley
a1cc214bbe ContentMixin: Set the Vary header.
This lets any transparent caches that our responses will vary based on
the Accept header.  Without this, caches will assume that a cached
response can be used even if the Accept header differs.
2016-03-13 09:34:32 -04:00
Dave Shawley
d571209e38 Remove _mark_deprecated wrapper. 2016-02-29 14:35:07 -05:00
Dave Shawley
baf643e3ef Metadata bumps for 2.0.0. 2016-02-24 14:47:39 -05:00
Dave Shawley
206e43ee7d ContentMixin: Raise 400 when body decode fails. 2016-02-22 09:58:58 -05:00
Dave Shawley
ee28d54036 Make content-type parameter to add_transcoder optional. 2016-02-01 10:06:46 -05:00
Dave Shawley
36a916a557 add_transcoder: Change parameter order.
This is the first part of making the content type parameter optional
2016-02-01 09:07:56 -05:00
Dave Shawley
f920298c54 Clean up a few documents. 2016-01-31 12:31:35 -05:00
Dave Shawley
ed357d878f Strip charset parameter from text content types. 2016-01-31 12:14:20 -05:00
Dave Shawley
995c715405 Normalize registered content types.
MIME content type strings are normalized by lower-casing the content
type parameters and then sorting them.  Each parameter is preceded by a
space.
2016-01-31 12:11:11 -05:00
Dave Shawley
98e3719a8b MsgPackTranscoder: Add BinaryWrapper override. 2016-01-18 07:58:30 -05:00
Dave Shawley
3a65dea053 MsgPackTranscoder: Handle binary data values. 2016-01-18 07:58:11 -05:00
Dave Shawley
ba3d7cfc84 MsgPackTranscoder: Add support for UUID and datetimes. 2016-01-18 07:58:11 -05:00
Dave Shawley
7d2237745e Add s.m.mediatype.transcoders.MsgPackTranscoder. 2016-01-18 07:58:07 -05:00
Dave Shawley
3eecbad5c5 content.ContentSettings: Fix AttributeError in __setitem__.
Code coverage FTW!
2016-01-16 09:56:38 -05:00
Dave Shawley
61713f9f15 JSONTranscoder: Add support for datetime, UUID, and binary types. 2016-01-16 09:56:38 -05:00
Dave Shawley
ee8f645a51 Add sprockets.mixins.mediatype.transcoders.JSONTranscoder. 2016-01-16 09:56:38 -05:00
Dave Shawley
d7f1bb1e4e Add content.add_transcoder. 2016-01-16 09:56:38 -05:00
Dave Shawley
f9cda82f64 Add deprecation warnings for top-level items. 2016-01-10 11:36:52 -05:00
Dave Shawley
ce54332cab Repackage sprockets.mixins.mediatype into a package.
Distributing a raw python module into a namespace package seems to be
somewhat unreliable though I haven't proven it yet...  In any case,
installing a package inside of a namespace package behaves itself.
2016-01-10 11:36:46 -05:00