Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json editor in StackedInline #1

Open
Fercho191 opened this issue Oct 3, 2017 · 2 comments
Open

Json editor in StackedInline #1

Fercho191 opened this issue Oct 3, 2017 · 2 comments

Comments

@Fercho191
Copy link

Fercho191 commented Oct 3, 2017

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

@abogushov
Copy link
Owner

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.

@linhfishCR7
Copy link

linhfishCR7 commented Jan 18, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants