smaller default size for newforms floats and ints(2)
This commit is contained in:
parent
ab8362432b
commit
3afc5bfb19
|
@ -199,7 +199,15 @@ class _DelugeIntInputWidget(newforms.TextInput):
|
|||
pass
|
||||
return newforms.TextInput.render(self, name, value, attrs)
|
||||
|
||||
class DelugeInt(newforms.IntegerField):
|
||||
class IntegerField(newforms.IntegerField):
|
||||
def widget_attrs(self, widget):
|
||||
return {'size': "8"}
|
||||
|
||||
class FloatField(newforms.FloatField):
|
||||
def widget_attrs(self, widget):
|
||||
return {'size': "8"}
|
||||
|
||||
class DelugeInt(IntegerField):
|
||||
def __init__(self, label , **kwargs):
|
||||
newforms.IntegerField.__init__(self, label=label, min_value=-1,
|
||||
max_value=sys.maxint, widget=_DelugeIntInputWidget, **kwargs)
|
||||
|
@ -209,10 +217,6 @@ class DelugeInt(newforms.IntegerField):
|
|||
value = -1
|
||||
return int(newforms.IntegerField.clean(self, value))
|
||||
|
||||
def widget_attrs(self, widget):
|
||||
return {'size': "8"}
|
||||
|
||||
|
||||
class DelugeFloat(DelugeInt):
|
||||
def clean(self, value):
|
||||
try:
|
||||
|
@ -221,14 +225,6 @@ class DelugeFloat(DelugeInt):
|
|||
pass
|
||||
return float(DelugeInt.clean(self, value))
|
||||
|
||||
def widget_attrs(self, widget):
|
||||
return {'size': "8"}
|
||||
|
||||
class FloatField(newforms.FloatField):
|
||||
def widget_attrs(self, widget):
|
||||
return {'size': "8"}
|
||||
|
||||
|
||||
|
||||
class StringList(Field):
|
||||
"""for a list of strings """
|
||||
|
|
Loading…
Reference in New Issue