1
0
mirror of https://github.com/django/django.git synced 2024-11-18 23:44:22 +00:00
django/tests/regressiontests/file_storage
Gary Wilson Jr d89ba464dd Changes to ImageFileDescriptor and ImageField to fix a few cases of setting image dimension fields.
* Moved dimension field update logic out of `ImageFileDescriptor.__set__` and into its own method on `ImageField`.
 * New `ImageField.update_dimension_fields` method is attached to model instance's `post_init` signal so that:
   * Dimension fields are set when defined before the ImageField.
   * Dimension fields are set when the field is assigned in the model constructor (fixes #11196), but only if the dimension fields don't already have values, so we avoid updating the dimensions every time an object is loaded from the database (fixes #11084).
 * Clear dimension fields when the ImageField is set to None, which also causes dimension fields to be cleared when `ImageFieldFile.delete()` is used.
 * Added many more tests for ImageField that test edge cases we weren't testing before, and moved the ImageField tests out of `file_storage` and into their own module within `model_fields`.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@10858 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-28 05:46:09 +00:00
..
__init__.py File storage refactoring, adding far more flexibility to Django's file handling. The new files.txt document has details of the new features. 2008-08-08 20:59:02 +00:00
models.py Changes to ImageFileDescriptor and ImageField to fix a few cases of setting image dimension fields. 2009-05-28 05:46:09 +00:00
test1.png Fixed #9786 -- Fixed inequality checking for django.db.models.fields.file.FieldFile class. 2008-12-16 04:52:55 +00:00
test.png File storage refactoring, adding far more flexibility to Django's file handling. The new files.txt document has details of the new features. 2008-08-08 20:59:02 +00:00
tests.py Fixed #8817: get_image_dimensions correctly closes the files it opens, and leaves open the ones it doesn't. Thanks, mitsuhiko. 2009-05-08 10:56:51 +00:00