コード例 #1
0
ファイル: models.py プロジェクト: adusca/kuma
    def save(self, name, content, save=True):
        new_filename = generate_filename_and_delete_previous(self, name)
        super(ImageFieldFile, self).save(new_filename, content, save)

        # Create associated scaled thumbnail image
        t_name = self.thumbnail_name()
        if t_name:
            thumb_file = scale_image(self.storage.open(new_filename),
                    (self.field.thumb_max_width, self.field.thumb_max_height))
            self.storage.save(t_name, thumb_file)
コード例 #2
0
ファイル: models.py プロジェクト: chadwickthebold/kuma
    def save(self, name, content, save=True):
        new_filename = generate_filename_and_delete_previous(self, name)
        super(ImageFieldFile, self).save(new_filename, content, save)

        # Create associated scaled thumbnail image
        t_name = self.thumbnail_name()
        if t_name:
            thumb_file = scale_image(
                self.storage.open(new_filename),
                (self.field.thumb_max_width, self.field.thumb_max_height))
            self.storage.save(t_name, thumb_file)
コード例 #3
0
ファイル: models.py プロジェクト: adusca/kuma
 def save(self, name, content, save=True):
     new_filename = generate_filename_and_delete_previous(self, name)
     super(ReplacingFieldZipFile, self).save(new_filename, content, save)
コード例 #4
0
ファイル: models.py プロジェクト: chadwickthebold/kuma
 def save(self, name, content, save=True):
     new_filename = generate_filename_and_delete_previous(self, name)
     super(ReplacingFieldZipFile, self).save(new_filename, content, save)