From ff10eab373bd3aae69469ecffed2b31a66ef3214 Mon Sep 17 00:00:00 2001 From: omniavx Date: Wed, 20 May 2015 00:11:46 -0500 Subject: [PATCH] Update dal.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I was running my application and got this error { cannot import name Set Version web2py™ Version 2.10.4-stable+timestamp.2015.04.26.15.11.54 Python Python 2.7.3: /usr/bin/python (prefix: /usr) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. Traceback (most recent call last): File "/home/www-data/web2py/gluon/restricted.py", line 227, in restricted exec ccode in environment File "/home/www-data/web2py/applications/omniavx_cxn/controllers/valuecache.py", line 6897, in File "/home/www-data/web2py/gluon/globals.py", line 393, in self._caller = lambda f: f() File "/home/www-data/web2py/applications/omniavx_cxn/controllers/valuecache.py", line 6584, in browse_bacct_callback from plugin_PowerGrid.CallBack import CallBack File "/home/www-data/web2py/gluon/custom_import.py", line 95, in custom_importer return base_importer(pname, globals, locals, fromlist, level) File "/home/www-data/web2py/gluon/custom_import.py", line 134, in __call__ result = NATIVE_IMPORTER(name, globals, locals, fromlist, level) File "applications/omniavx_cxn/modules/plugin_PowerGrid/CallBack.py", line 41, in from gluon.dal import Table ,Query, Set, Rows, Row ImportError: cannot import name Set } same code produced no error in earlier version of web2py line 15 of web2py/gluon/dal.py is { from pydal.objects import Row, Rows, Table, Query, Expression } replacing that with { from pydal.objects import Row, Rows, Table, Query, Set, Expression } solves the problem --- gluon/dal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/dal.py b/gluon/dal.py index dbae0d39..f8579a70 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -12,7 +12,7 @@ Takes care of adapting pyDAL to web2py's needs from pydal import DAL as DAL from pydal import Field -from pydal.objects import Row, Rows, Table, Query, Expression +from pydal.objects import Row, Rows, Table, Query, Set, Expression from pydal import SQLCustomType, geoPoint, geoLine, geoPolygon