Exemplo n.º 1
0
 def formfield(self, **kwargs):
     defaults = {'form_class': forms.CharField}
     defaults.update(kwargs)
     if defaults.get('widget') == admin_widgets.AdminIntegerFieldWidget:
         defaults['widget'] = admin_widgets.AdminTextInputWidget
     if defaults.get('widget') == admin_widgets.AdminBigIntegerFieldWidget:
         defaults['widget'] = admin_widgets.AdminTextInputWidget
     # noinspection PyCallByClass,PyTypeChecker
     return Field.formfield(self, **defaults)
Exemplo n.º 2
0
    def formfield(self, **kwargs):

        defaults = {'max_length': self.max_length, 'widget': RubricateWidget}
        kwargs.update(defaults)
        return Field.formfield(self, **kwargs)