DAL.validators_method become a bound method, requires dal instance as first parameter

This commit is contained in:
gi0baro
2014-12-24 15:19:34 +01:00
parent 8000bda0c9
commit ea14c5b83b
2 changed files with 3 additions and 3 deletions
+1 -2
View File
@@ -4,7 +4,7 @@ from pydal import DAL as pyDAL
from pydal import Field, SQLCustomType, geoPoint, geoLine, geoPolygon
def _default_validators(field):
def _default_validators(db, field):
"""
Field type validation, using web2py's validators mechanism.
@@ -12,7 +12,6 @@ def _default_validators(field):
fieldtype
"""
from gluon import validators
db = field.db
field_type, field_length = field.type, field.length
requires = []
+2 -1
View File
@@ -1127,7 +1127,8 @@ class SQLFORM(FORM):
extra_field.table = table
extra_field.tablename = table._tablename
if extra_field.requires == DEFAULT:
extra_field.requires = _default_validators(extra_field)
extra_field.requires = _default_validators(table._db,
extra_field)
for fieldname in self.fields:
if fieldname.find('.') >= 0: