Closed ghost closed 8 years ago
According to the docs you should be able to override the mentioned attributes, however setting them has no effect.
This is what I've done
class CustomClearableFileInput(floppy.ClearableFileInput): """Override template on ClearableFileInput. """ clear_checkbox_label = 'Remove custom cover'
but the output shows the default text. As far as I can see ClearableFileInput doesn't actually use these attributes, despite the documentation saying:
The initial_text, input_text and clear_checkbox_label attributes are provided in the template context.
I've also tried:
custom_background = forms.ImageField( required=False, widget=forms.ClearableFileInput( attrs={ 'accept': ','.join(settings.ALLOWED_IMAGE_TYPES), 'clear_checkbox_label': 'Remove custom cover'} ), validators=[image_format_validator] )
Hi, thanks for the report. I've added the labels as documented and released 1.6.2 that contains the fix.
According to the docs you should be able to override the mentioned attributes, however setting them has no effect.
This is what I've done
but the output shows the default text. As far as I can see ClearableFileInput doesn't actually use these attributes, despite the documentation saying:
I've also tried: