Ticket #1537: meta_field_ImageField.diff

File meta_field_ImageField.diff, 1.1 KB (added by django@…, 18 years ago)

Patch for core/meta/fields.py to correct ImageField dimension db updating

  • fields.py

     
    555555    def get_manipulator_field_objs(self):
    556556        return [formfields.ImageUploadField, formfields.HiddenField]
    557557
    558     def save_file(self, new_data, new_object, original_object, change, rel):
    559         FileField.save_file(self, new_data, new_object, original_object, change, rel)
    560         # If the image has height and/or width field(s) and they haven't
    561         # changed, set the width and/or height field(s) back to their original
    562         # values.
    563         if change and (self.width_field or self.height_field):
    564             if self.width_field:
    565                 setattr(new_object, self.width_field, getattr(original_object, self.width_field))
    566             if self.height_field:
    567                 setattr(new_object, self.height_field, getattr(original_object, self.height_field))
    568             new_object.save()
    569 
    570558class IntegerField(Field):
    571559    empty_strings_allowed = False
    572560    def get_manipulator_field_objs(self):
Back to Top