fixed DAL.__new__ and SQLFORM.factory

This commit is contained in:
mdipierro
2012-10-01 19:15:37 -05:00
parent 485719ca1f
commit 6cc29e4527
2 changed files with 5 additions and 2 deletions

View File

@@ -1 +1 @@
Version 2.0.9 (2012-10-01 17:06:56) dev
Version 2.0.9 (2012-10-01 19:15:30) dev

View File

@@ -6572,7 +6572,10 @@ class DAL(object):
Field('fieldname2'))
"""
def __new__(cls, uri='sqlite://dummy.db', *args, **kwargs):
def __new__(cls, uri='sqlite://dummy.db', *args, **kwargs):
if uri==None and not 'singleton_code' in kwargs:
# this deal with the special case of Dummy DAL for SQLFORM.factory
return super(DAL, cls).__new__(cls, uri, *args, **kwargs)
if not hasattr(THREAD_LOCAL,'db_instances'):
THREAD_LOCAL.db_instances = {}
if 'singleton_code' in kwargs: