diff --git a/VERSION b/VERSION index 4a24ded7..4bef81dc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.2.1 (2012-11-29 22:34:41) stable +Version 2.2.1 (2012-11-29 23:53:48) stable diff --git a/gluon/dal.py b/gluon/dal.py index e74deda5..4b489813 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -7174,7 +7174,12 @@ def index(): table = table_class(self, tablename, *fields, **args) table._actual = True self[tablename] = table - table._create_references() # must follow above line to handle self references + # fix self refrences + for field in table: + if field.requires == DEFAULT: + field.requires = sqlhtml_validators(field) + # must follow above line to handle self references + table._create_references() migrate = self._migrate_enabled and args_get('migrate',self._migrate) if migrate and not self._uri in (None,'None') \ @@ -7591,7 +7596,10 @@ class Table(object): db._adapter.maxcharlength < field.length: field.length = db._adapter.maxcharlength if field.requires == DEFAULT: - field.requires = sqlhtml_validators(field) + try: + field.requires = sqlhtml_validators(field) + except AttributeError: + pass self.ALL = SQLALL(self) if hasattr(self,'_primarykey'): diff --git a/gluon/main.py b/gluon/main.py index bbdaac97..58df9dfa 100644 --- a/gluon/main.py +++ b/gluon/main.py @@ -457,14 +457,14 @@ def wsgibase(environ, responder): x_req_with = str(env.http_x_requested_with).lower() request.update( - client=client, - folder=abspath('applications', app) + os.sep, - ajax=x_req_with == 'xmlhttprequest', - cid=env.http_web2py_component_element, - is_local=env.remote_addr in local_hosts, - is_https=env.wsgi_url_scheme in HTTPS_SCHEMES - or request.env.http_x_forwarded_proto in HTTPS_SCHEMES - or env.https == 'on') + client = client, + folder = abspath('applications', app) + os.sep, + ajax = x_req_with == 'xmlhttprequest', + cid = env.http_web2py_component_element, + is_local = env.remote_addr in local_hosts, + is_https = env.wsgi_url_scheme in HTTPS_SCHEMES or \ + request.env.http_x_forwarded_proto in HTTPS_SCHEMES \ + or env.https == 'on') request.compute_uuid() # requires client request.url = environ['PATH_INFO']