diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-12-15 00:26:08 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2013-03-02 10:29:02 +0100 |
| commit | d680a3f4477056c69629b0421db4bb254b8c69d0 (patch) | |
| tree | 44c4e17bde6c2b906666c88e0846b550667d3d0e /django/utils/encoding.py | |
| parent | 8ee1eddb7e148de89aebde9e68da495633fc1ec9 (diff) | |
Added support for serializing BinaryField
Diffstat (limited to 'django/utils/encoding.py')
| -rw-r--r-- | django/utils/encoding.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/utils/encoding.py b/django/utils/encoding.py index 68929cc0e5..607b48277a 100644 --- a/django/utils/encoding.py +++ b/django/utils/encoding.py @@ -142,6 +142,8 @@ def force_bytes(s, encoding='utf-8', strings_only=False, errors='strict'): If strings_only is True, don't convert (some) non-string-like objects. """ + if isinstance(s, six.memoryview): + s = bytes(s) if isinstance(s, bytes): if encoding == 'utf-8': return s |
