From 2a27563f300b105ff28cae05eda18419d9fcde63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonel=20C=C3=A2mara?= Date: Thu, 14 Aug 2014 18:02:00 +0100 Subject: [PATCH] Allows you to set SQLFORM.default_formstyle and set the default formstyle for all SQLFORMs --- gluon/sqlhtml.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index c03930c1..dc22c59f 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -971,6 +971,8 @@ class SQLFORM(FORM): inline=formstyle_inline, ) + default_formstyle='table3cols' + FIELDNAME_REQUEST_DELETE = 'delete_this_record' FIELDKEY_DELETE_RECORD = 'delete_record' ID_LABEL_SUFFIX = '__label' @@ -1013,7 +1015,7 @@ class SQLFORM(FORM): keepopts=[], ignore_rw=False, record_id=None, - formstyle='table3cols', + formstyle=None, buttons=['submit'], separator=': ', extra_fields=None, @@ -1022,7 +1024,7 @@ class SQLFORM(FORM): T = current.T self.ignore_rw = ignore_rw - self.formstyle = formstyle + self.formstyle = formstyle or SQLFORM.default_formstyle self.readonly = readonly # Default dbio setting self.detect_record_change = None