fixed backward compatibility issue formstyles, thanks Dominic

This commit is contained in:
mdipierro
2012-08-21 08:52:06 -05:00
parent e5afc3ede8
commit 8d923a5765
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-08-21 07:57:05) dev
Version 2.00.0 (2012-08-21 08:52:02) dev
@@ -1379,6 +1379,7 @@ def errors():
return dict(errors = [x[1] for x in decorated], app=app, method=method, db_ready=db_ready)
elif method == 'dbnew':
errors_path = apath('%s/errors' % app, r=request)
tk_db, tk_table = get_ticket_storage(app)
+3 -2
View File
@@ -1086,7 +1086,8 @@ class SQLFORM(FORM):
if callable(self.formstyle):
# backward compatibility, 4 argument function is the old style
if len(inspect.getargspec(self.formstyle)[0]) == 4:
args, varargs, keywords, defaults = inspect.getargspec(self.formstyle)
if defaults and len(args) - len(defaults) == 4 or len(args) == 4:
table = TABLE()
for id,a,b,c in xfields:
raw_b = self.field_parent[id] = b
@@ -1815,7 +1816,7 @@ class SQLFORM(FORM):
filename = '.'.join(('rows', oExp.file_ext))
response.headers['Content-Type'] = oExp.content_type
response.headers['Content-Disposition'] = \
'attachment;filename='+filename+';'
'attachment;filename='+filename+';'
raise HTTP(200, oExp.export(),**response.headers)
elif request.vars.records and not isinstance(