在编辑具有图像字段的对象时,您会看到当前图像路径和标准文件上传字段。我想要做的是能够用实际图像替换显示的路径(“当前:/pathtoimage.jpg”。我该怎么做?
提前致谢!
最佳答案
如果您在讨论 Django 管理中的表单,您可以覆盖 AdminImageWidget。
有几个片段和帖子解释了细节:
对于常规表格,您应该查看 django-form-utils :
This application provides utilities for enhancing Django's form handling:
An ImageWidget which display a thumbnail of the image rather than just the filename.
关于python - Django - 在图像编辑表单中删除 "Currently"并将其替换为实际图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5722899/