Ticket #7968: modelforms-doc-imagefields.diff

File modelforms-doc-imagefields.diff, 1.2 KB (added by sime, 10 years ago)

Brief note about existing behaviour, and a suggestion on how to handle removing existing images/files

  • docs/modelforms.txt

    5555    ``FilePathField``                ``CharField``
    5656    ``FloatField``                   ``FloatField``
    5757    ``ForeignKey``                   ``ModelChoiceField`` (see below)
    58     ``ImageField``                   ``ImageField``
     58    ``ImageField``                   ``ImageField`` (see below)
    5959    ``IntegerField``                 ``IntegerField``
    6060    ``IPAddressField``               ``IPAddressField``
    6161    ``ManyToManyField``              ``ModelMultipleChoiceField`` (see
    112112      field has ``blank=False`` and an explicit ``default`` value (the
    113113      ``default`` value will be initially selected instead).
     115When ``ImageField`` or ``FileField`` fields are left blank by the user, they
     116will be skipped during a ``save()``. Any existing image or file will remain.
     117We suggest you use a BooleanField to allow the user to remove an existing
     118image or file.
    115120Finally, note that you can override the form field used for a given model
    116121field. See `Overriding the default field types`_ below.
Back to Top