📌  相关文章
📜  如何使用 SVGAndImageFormField 在 django 图像字段中存储 svgs - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:20.177000             🧑  作者: Mango

代码示例1
class MyModelForm(forms.ModelForm):
    class Meta:
        model = MyModel
        exclude = []
        field_classes = {
            'image_field': SVGAndImageFormField,
        }

class MyModelAdmin(admin.ModelAdmin):
    form = MyModelForm

admin.site.register(MyModel, MyModelAdmin)