allow arbistrary params to formstyle=style(placeholder=True, errors='down'), thanks André Kablu
This commit is contained in:
+3
-2
@@ -35,7 +35,7 @@ import re
|
||||
import cStringIO
|
||||
from gluon.globals import current
|
||||
from gluon.http import redirect
|
||||
import inspect
|
||||
from gluon.utils import get_callable_argspec
|
||||
|
||||
try:
|
||||
import gluon.settings as settings
|
||||
@@ -1278,6 +1278,7 @@ class SQLFORM(FORM):
|
||||
table = self.createform(xfields)
|
||||
self.components = [table]
|
||||
|
||||
|
||||
def createform(self, xfields):
|
||||
formstyle = self.formstyle
|
||||
if isinstance(formstyle, basestring):
|
||||
@@ -1288,7 +1289,7 @@ class SQLFORM(FORM):
|
||||
|
||||
if callable(formstyle):
|
||||
# backward compatibility, 4 argument function is the old style
|
||||
args, varargs, keywords, defaults = inspect.getargspec(formstyle)
|
||||
args, varargs, keywords, defaults = get_callable_argspec(formstyle)
|
||||
if defaults and len(args) - len(defaults) == 4 or len(args) == 4:
|
||||
table = TABLE()
|
||||
for id, a, b, c in xfields:
|
||||
|
||||
Reference in New Issue
Block a user