Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Slight optimiztion for floats and ints.

  • Loading branch information...
commit b74ec365b95ff2e6dbfd58e82ebcf4d0bfb209f9 1 parent 21e2e0c
Nathan Villaescusa authored
Showing with 4 additions and 7 deletions.
  1. +4 −7 tabby/fields.py
View
11 tabby/fields.py
@@ -69,7 +69,7 @@ def parse(self, value):
return self.default
try:
- return self.coerce(value)
+ return self.coercer(value)
except ValueError, e:
if value.isspace():
if self.required:
@@ -107,14 +107,11 @@ def coerce(self, value):
return True
class IntField(_NumberField):
-
- def coerce(self, value):
- return int(value)
+
+ coercer = int
class FloatField(_NumberField):
-
- def coerce(self, value):
- return float(value)
+ coercer = float
class TimeField(Field):
def coerce(self, value):
Please sign in to comment.
Something went wrong with that request. Please try again.