Django Imagefield Not Rendering Clearablefileinput
Starting to beat my head against the wall...perhaps I am missing something simple. models.py class GFImage(models.Model): image = models.ImageField(upload_to = 'uploads', null=
Solution 1:
The ClearableFileInput
will only display the clear checkbox when there's an initial file selected. Looking at your form, it looks like a a new form without initial data, so the checkbox won't be displayed.
defrender(self, name, value, attrs=None):
.. snip ..
if value andhasattr(value, "url"):
template = self.template_with_initial
substitutions['initial'] = format_html(self.url_markup_template,
Post a Comment for "Django Imagefield Not Rendering Clearablefileinput"