How to display/use delete button on preview? #86
Answered
by
EduardoJM
sheckathorne
asked this question in
Q&A
-
First, thanks for this great app, it looks so much better than the Django uploader. How can you enable the delete button in the preview? I've read through the docs and don't find it mentioned. I looked through the source code a bit and tried this on my form which didn't seem to work:
|
Beta Was this translation helpful? Give feedback.
Answered by
EduardoJM
Jan 13, 2023
Replies: 1 comment
-
Thanks for the comment. The delete button is shown when the field is not required into the django form. To made the field not required, add class TestNonRequiredInlineItem(models.Model):
# ...
image = models.ImageField('Image', null=True, blank=True) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
EduardoJM
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Thanks for the comment. The delete button is shown when the field is not required into the django form. To made the field not required, add
null=True, blank=True
to the ImageField, like it: