Ejemplo n.º 1
0
 def formfield_for_dbfield(self, db_field, **kwargs):
     """ Make value input widget bigger """
     if db_field.name == 'address':
         kwargs['widget'] = forms.Textarea(attrs={'cols': 70, 'rows': 2})
     if db_field.name == 'email_usage':
         kwargs['widget'] = paddingCheckboxSelectMultiple(130)
     return super(ContactAdmin, self).formfield_for_dbfield(db_field, **kwargs)
Ejemplo n.º 2
0
 def formfield_for_dbfield(self, db_field, **kwargs):
     """ Make value input widget bigger """
     if db_field.name == 'address':
         kwargs['widget'] = forms.Textarea(attrs={'cols': 70, 'rows': 2})
     if db_field.name == 'email_usage':
         kwargs['widget'] = paddingCheckboxSelectMultiple(130)
     return super(ContactAdmin,
                  self).formfield_for_dbfield(db_field, **kwargs)
Ejemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     super(RouteForm, self).__init__(*args, **kwargs)
     if self.instance:
         self.fields['backend'].widget = SpanWidget()
         self.fields['backend'].required = False
         self.fields['async_actions'].widget = paddingCheckboxSelectMultiple(45)
         actions = self.instance.backend_class.actions
         self.fields['async_actions'].choices = ((action, action) for action in actions)
Ejemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     super(RouteForm, self).__init__(*args, **kwargs)
     if self.instance:
         self.fields['backend'].required = False
         try:
             backend_class = self.instance.backend_class
         except KeyError:
             self.fields['backend'].widget = SpanWidget(
                 display='<span style="color:red">%s NOT AVAILABLE</span>' % self.instance.backend)
         else:
             self.fields['backend'].widget = SpanWidget()
             actions = backend_class.actions
             self.fields['async_actions'].widget = paddingCheckboxSelectMultiple(45)
             self.fields['async_actions'].choices = ((action, action) for action in actions)
Ejemplo n.º 5
0
 def __init__(self, *args, **kwargs):
     super(RouteForm, self).__init__(*args, **kwargs)
     if self.instance:
         self.fields['backend'].required = False
         try:
             backend_class = self.instance.backend_class
         except KeyError:
             self.fields['backend'].widget = SpanWidget(
                 display='<span style="color:red">%s NOT AVAILABLE</span>' %
                 self.instance.backend)
         else:
             self.fields['backend'].widget = SpanWidget()
             actions = backend_class.actions
             self.fields[
                 'async_actions'].widget = paddingCheckboxSelectMultiple(45)
             self.fields['async_actions'].choices = ((action, action)
                                                     for action in actions)