Ticket #10058: 10058.diff

File 10058.diff, 632 bytes (added by kyle.fox@…, 16 years ago)

Use AdminFileWidget in the admin for FileField and ImageField

  • options.py

     
    103103
    104104            return formfield
    105105                   
     106        # For FileFields and ImageFields add a link to the current file.
     107        if isinstance(db_field, (models.FileField, models.ImageField)):
     108            kwargs['widget'] = widgets.AdminFileWidget
     109
    106110        # If we've got overrides for the formfield defined, use 'em. **kwargs
    107111        # passed to formfield_for_dbfield override the defaults.
    108112        if db_field.__class__ in self.formfield_overrides:
Back to Top