Exemplo n.º 1
0
 def get_form(self, request, obj=None, **kwargs):
     """
     Build the form used for changing the model.
     """
     kwargs.update(widgets={
         'options': JSONMultiWidget(self.option_fields),
     })
     form = super(RevealExtensionAdmin, self).get_form(request, obj, **kwargs)
     rectify_partial_form_field(form.base_fields['options'], self.option_fields)
     form.option_fields = self.option_fields
     return form
Exemplo n.º 2
0
 def get_form(self, request, obj=None, **kwargs):
     """
     Build the form used for changing the model.
     """
     kwargs.update(widgets={'css_classes': JSONMultiWidget(self.classname_fields),
         'inline_styles': JSONMultiWidget(self.style_fields)})
     form = super(PluginExtraFieldsAdmin, self).get_form(request, obj, **kwargs)
     rectify_partial_form_field(form.base_fields['css_classes'], self.classname_fields)
     setattr(form, 'classname_fields', self.classname_fields)
     rectify_partial_form_field(form.base_fields['inline_styles'], self.style_fields)
     setattr(form, 'style_fields', self.style_fields)
     return form
Exemplo n.º 3
0
 def get_form(self, request, obj=None, **kwargs):
     """
     Build the form used for changing the model.
     """
     kwargs.update(widgets={
         'options': JSONMultiWidget(self.option_fields),
     })
     form = super(RevealExtensionAdmin,
                  self).get_form(request, obj, **kwargs)
     rectify_partial_form_field(form.base_fields['options'],
                                self.option_fields)
     form.option_fields = self.option_fields
     return form
Exemplo n.º 4
0
 def get_form(self, request, obj=None, **kwargs):
     """
     Build the form used for changing the model.
     """
     kwargs.update(widgets={
         'plugin_type': widgets.Select(choices=self.plugins_for_site),
         'css_classes': JSONMultiWidget(self.classname_fields),
         'inline_styles': JSONMultiWidget(self.style_fields)
     })
     form = super(PluginExtraFieldsAdmin, self).get_form(request, obj, **kwargs)
     rectify_partial_form_field(form.base_fields['css_classes'], self.classname_fields)
     form.classname_fields = self.classname_fields
     rectify_partial_form_field(form.base_fields['inline_styles'], self.style_fields)
     form.style_fields = self.style_fields
     return form
Exemplo n.º 5
0
 def get_form(self, request, obj=None, **kwargs):
     """
     Build the form used for changing the model.
     """
     kwargs.update(
         widgets={
             'css_classes': JSONMultiWidget(self.classname_fields),
             'inline_styles': JSONMultiWidget(self.style_fields)
         })
     form = super(PluginExtraFieldsAdmin,
                  self).get_form(request, obj, **kwargs)
     rectify_partial_form_field(form.base_fields['css_classes'],
                                self.classname_fields)
     setattr(form, 'classname_fields', self.classname_fields)
     rectify_partial_form_field(form.base_fields['inline_styles'],
                                self.style_fields)
     setattr(form, 'style_fields', self.style_fields)
     return form