django-admin-json-editor
django-admin-json-editor copied to clipboard
Json editor in StackedInline
Hello! Thanks for the work in this repository, it works great!
I had a problem and I did not know how to fix it:
I tried to place the form in an admin.StackedInline
, then add it to an admin.ModelAdmin
the template worked correctly with the schema, however, sending the form caused error because the field was in None.
class AnotherModelAdminForm(ModelForm):
class Meta:
model = AnotherModel
fields = '__all__'
widgets = {
'json_field': JSONEditorWidget(SCHEMA, collapsed=False),
}
class AnotherModelAdmin(admin.StackedInline):
model = AnotherModel
form = AnotherModelAdminForm
@admin.register(MyModel)
class MyModelAdmin(admin.ModelAdmin):
inlines = [
AnotherModelAdmin,
]
Can you think of a solution?
Thanks in advance
Hello. Thanks for your words! There is problem with js during binding editor. I will try to solve this and, if I succeed, I will add an example.
Thanks for the issue.
Hello. Thanks for your words! There is problem with js during binding editor. I will try to solve this and, if I succeed, I will add an example.
Thanks for the issue.
Has this problem been solved yet? Thanks