Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
 def save(self, name, content, save=True):
     new_filename = generate_filename_and_delete_previous(self, name)
     super(ReplacingFieldZipFile, self).save(new_filename, content, save)
Ejemplo n.º 4
0
 def save(self, name, content, save=True):
     new_filename = generate_filename_and_delete_previous(self, name)
     super(ReplacingFieldZipFile, self).save(new_filename, content, save)