# Path: djedi/plugins/base.py
# class DjediPlugin(BasePlugin):
#     def get_editor_context(self, **kwargs):
#         """
#         Returns custom context
#         """
#         return kwargs


import json
from djedi.plugins.base import DjediPlugin
from django import forms
def get_custom_render_widget(cls):
    class CustomRenderWidget(cls):
        def render(self, *args, **kwargs):
            name = kwargs.pop("name", None)

            if not name:
                name = args[0]
                args = args[1:]

            name = deprefix(name)

            return super(CustomRenderWidget, self).render(
                "data[%s]" % name,
                *args,
                **kwargs
            )

    return CustomRenderWidget


class BaseEditorForm(forms.Form):
    def __init__(self, *args, **kwargs):
        super(BaseEditorForm, self).__init__(*args, **kwargs)

        for field in list(self.fields.keys()):
            self.fields[field].widget.__class__ = get_custom_render_widget(
                self.fields[field].widget.__class__
            )



# Path: djedi/plugins/base.py
# class DjediPlugin(BasePlugin):
#     def get_editor_context(self, **kwargs):
#         """
#         Returns custom context
#         """
#         return kwargs


# Path: djedi/plugins/form.py
import json
from djedi.plugins.base import DjediPlugin
from django import forms

def get_custom_render_widget(cls):
    class CustomRenderWidget(cls):
        def render(self, *args, **kwargs):
            name = kwargs.pop("name", None)

            if not name:
                name = args[0]
                args = args[1:]

            name = deprefix(name)

            return super(CustomRenderWidget, self).render(
                "data[%s]" % name,
                *args,
                **kwargs
            )

    return CustomRenderWidget


class BaseEditorForm(forms.Form):
    def __init__(self, *args, **kwargs):
        super(BaseEditorForm, self).__init__(*args, **kwargs)

        for field in list(self.fields.keys()):
            self.fields[field].widget.__class__ = get_custom_render_widget(
                self.fields[field].widget.__class__
            )



class FormsBasePlugin(DjediPlugin):