Example #1
0
    def _generate_upload_filename(filename):
        filename = filename.lower()

        name, extension = os.path.splitext(filename)
        while Image.where('name', '=', filename).count() == 1:
            uid = shortuuid.uuid()[0:7]
            filename = "{}-{}.{}".format(name, uid, extension)

        return filename
Example #2
0
 def images(self):
     Image.where('bucket_name', '=', self.bucket_name)