abogushov / django-admin-json-editor

Adds json-editor for JSONField in Django Administration
MIT License
173 stars 61 forks source link

how can I make the field optional not always required #21

Closed Fettah closed 6 years ago

Fettah commented 6 years ago

as described in the documentation, i used a form for one of my fields

class ProductAdminForm(forms.ModelForm):
    class Meta:
        model = User
        fields = '__all__'
        widgets = {
            'editorial_data': JSONEditorWidget(DATA_SCHEMA, collapsed=False),
        }

but it seems that now I cannot save unless I provide that field. How can I make it optionaly

Fettah commented 6 years ago

my bad, that was related to my model.