From 4a2a02d1fe98030ea376ee2ba0a1d008dfa04f64 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sat, 2 Dec 2017 12:52:15 -0600 Subject: [PATCH] fixed display of computed fields --- applications/welcome/static/css/web2py-bootstrap4.css | 4 ++++ gluon/sqlhtml.py | 7 ++++--- gluon/tools.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/applications/welcome/static/css/web2py-bootstrap4.css b/applications/welcome/static/css/web2py-bootstrap4.css index 750120ca..a6846d48 100644 --- a/applications/welcome/static/css/web2py-bootstrap4.css +++ b/applications/welcome/static/css/web2py-bootstrap4.css @@ -1,3 +1,7 @@ +label, th { + font-weigth: bold; + white-space: nowrap; +} div.w2p_flash { background-image: none; border-radius: 4px; diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index dbe93241..213a38a9 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -1345,9 +1345,10 @@ class SQLFORM(FORM): # if no fields are provided, build it from the provided table # will only use writable or readable fields, unless forced to ignore if fields is None: - fields = [f.name for f in table if - (ignore_rw or f.writable or f.readable) and - not (f.compute and not record)] + if not readonly: + fields = [f.name for f in table if (ignore_rw or f.writable) and (not f.compute or record)] + else: + fields = [f.name for f in table if (ignore_rw or f.readable)] self.fields = fields # make sure we have an id diff --git a/gluon/tools.py b/gluon/tools.py index fad0ef33..f57e8dd7 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -3051,7 +3051,7 @@ class Auth(AuthAPI): if self.settings.register_verify_password: if self.settings.register_fields is None: - self.settings.register_fields = [f.name for f in table_user if f.writable] + self.settings.register_fields = [f.name for f in table_user if f.writable and not f.compute] k = self.settings.register_fields.index(passfield) self.settings.register_fields.insert(k + 1, "password_two") extra_fields = [