Support buffer/memoryview types in Base64Field.
Review Request #10843 — Created Jan. 21, 2020 and submitted
Django can end up giving us a
buffer
(Python 2.x) ormemoryview
(Python 3.x) value when instantiating a field from a row in the
database. This wasn't supported inBase64Field
, and led to breakages
in one part of the administration UI.This extends
Base64Field
to work correctly with asix.memoryview
(which maps to the correct type on both versions of Python). Unit tests
ensure that all the type-specific behavior will work correctly when
provided with these values.
Unit tests pass on all supported versions of Python.
Verified that I was able to load the objects in the administration UI
that were triggering this bug.