From 6cc29e452731375cab550db830a5f73bc331edfb Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 1 Oct 2012 19:15:37 -0500 Subject: [PATCH] fixed DAL.__new__ and SQLFORM.factory --- VERSION | 2 +- gluon/dal.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index ae05d6ee..7aa13c43 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.9 (2012-10-01 17:06:56) dev +Version 2.0.9 (2012-10-01 19:15:30) dev diff --git a/gluon/dal.py b/gluon/dal.py index bafe2af0..8062dac4 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -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: