Add a function to get raw base64 content on Base64Fields.
Review Request #6209 — Created Aug. 7, 2014 and submitted
Base64Field now provides a
get_<fieldname>_base64()
function that will
return the actual Base64 content, rather than the decoded content.
Made use of this in another change. Verified that I got the proper content.
Description | From | Last Updated |
---|---|---|
Can you reorder these a bit? super(Base64field, self).contribute_to_class(cls, name) setattr(cls, self.name, Base64FieldCreator(self)) def get_base64(model_instance): return self.value_to_string(model_instance) setattr(cls, 'get_%s_base64' % self.name, … |
david |
- Change Summary:
-
- The
get_*_base64
now just returns the encoded data stored as part of the model instance, instead of re-encoding. - Simplified the code by removing the function and using a lambda.
- The
- Commit:
-
13ce744ac64afb59ada7456af34bc3b9e98c1ecd0710dc38af06c232cd5af483f9044a9695bd3a10
- Diff:
-
Revision 2 (+3)