Add a function to get raw base64 content on Base64Fields.

Review Request #6209 — Created Aug. 7, 2014 and submitted

chipx86
Djblets
release-0.8.x
6208
0710dc3...
djblets

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, ...

daviddavid
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/db/fields.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/db/fields.py
    
    
  2. 
      
david
  1. 
      
  2. djblets/db/fields.py (Diff revision 1)
     
     
     
     
     
     
     
     

    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, get_base64)
    
  3. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/db/fields.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/db/fields.py
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.8.x (492c7f2)
Loading...