Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/d/j/django-lionheart-helpers-1.0.5/lionheart/storages.py   django-lionheart-helpers(Download)
    def _open(self, name, mode='rb'):
        assert mode == 'rb', "You've tried to open binary file without specifying binary mode! You specified: %s" % mode
 
        obj = UploadedFile.objects.get(filename=name)
        file = StringIO.StringIO(base64.b64decode(obj.blob))
    def url(self, name):
        uploaded_file = UploadedFile.objects.get(filename=name)
        mtype, encoding = mimetypes.guess_type(name)
        return "data:{0};base64,{1}".format(mtype, uploaded_file.blob)
 
    def size(self, name):
        uploaded_file = UploadedFile.objects.get(filename=name)