smaller default size for newforms floats and ints

This commit is contained in:
Martijn Voncken 2008-11-25 19:56:46 +00:00
parent 35ebf57060
commit ab8362432b
1 changed files with 12 additions and 0 deletions

View File

@ -209,6 +209,10 @@ 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:
@ -217,6 +221,14 @@ 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 """