diff --git a/gluon/__init__.py b/gluon/__init__.py index baf54a5b..6e5b8f5f 100644 --- a/gluon/__init__.py +++ b/gluon/__init__.py @@ -12,8 +12,8 @@ Web2Py framework modules __all__ = ['A', 'B', 'BEAUTIFY', 'BODY', 'BR', 'CAT', 'CENTER', 'CLEANUP', 'CODE', 'CRYPT', 'DAL', 'DIV', 'EM', 'EMBED', 'FIELDSET', 'FORM', 'Field', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEAD', 'HR', 'HTML', 'HTTP', 'I', 'IFRAME', 'IMG', 'INPUT', 'IS_ALPHANUMERIC', 'IS_DATE', 'IS_DATETIME', 'IS_DATETIME_IN_RANGE', 'IS_DATE_IN_RANGE', 'IS_DECIMAL_IN_RANGE', 'IS_EMAIL', 'IS_LIST_OF_EMAILS', 'IS_EMPTY_OR', 'IS_EQUAL_TO', 'IS_EXPR', 'IS_FLOAT_IN_RANGE', 'IS_IMAGE', 'IS_JSON', 'IS_INT_IN_RANGE', 'IS_IN_DB', 'IS_IN_SET', 'IS_IPV4', 'IS_LENGTH', 'IS_LIST_OF', 'IS_LOWER', 'IS_MATCH', 'IS_NOT_EMPTY', 'IS_NOT_IN_DB', 'IS_NULL_OR', 'IS_SLUG', 'IS_STRONG', 'IS_TIME', 'IS_UPLOAD_FILENAME', 'IS_UPPER', 'IS_URL', 'LABEL', 'LEGEND', 'LI', 'LINK', 'LOAD', 'MARKMIN', 'MENU', 'META', 'OBJECT', 'OL', 'ON', 'OPTGROUP', 'OPTION', 'P', 'PRE', 'SCRIPT', 'SELECT', 'SPAN', 'SQLFORM', 'SQLTABLE', 'STRONG', 'STYLE', 'TABLE', 'TAG', 'TBODY', 'TD', 'TEXTAREA', 'TFOOT', 'TH', 'THEAD', 'TITLE', 'TR', 'TT', 'UL', 'URL', 'XHTML', 'XML', 'redirect', 'current', 'embed64'] -from globals import current from contrib import pydal +from globals import current from html import * from validators import * from http import redirect, HTTP diff --git a/gluon/compileapp.py b/gluon/compileapp.py index c8cd2356..a6394513 100644 --- a/gluon/compileapp.py +++ b/gluon/compileapp.py @@ -26,7 +26,7 @@ from gluon.fileutils import mktree, listdir, read_file, write_file from gluon.myregex import regex_expose, regex_longcomments from gluon.languages import translator from gluon.dal import DAL, Field -from gluon.pydal.base import BaseAdapter +from pydal.base import BaseAdapter from gluon.sqlhtml import SQLFORM, SQLTABLE from gluon.cache import Cache from gluon.globals import current, Response diff --git a/gluon/contrib/__init__.py b/gluon/contrib/__init__.py index 195e3d0a..6e86cf30 100644 --- a/gluon/contrib/__init__.py +++ b/gluon/contrib/__init__.py @@ -1,6 +1,8 @@ import os import sys -sys.path.append(os.path.join(os.path.abspath(__file__), "pydal")) +sys.path.append(os.path.join( + os.path.dirname(os.path.abspath(__file__)), "pydal")) import pydal +sys.modules['pydal'] = pydal diff --git a/gluon/dal.py b/gluon/dal.py index 4844be57..19896993 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -from gluon.pydal import DAL as pyDAL -from gluon.pydal import Field, SQLCustomType, geoPoint, geoLine, geoPolygon +from pydal import DAL as pyDAL +from pydal import Field, SQLCustomType, geoPoint, geoLine, geoPolygon from gluon import serializers as w2p_serializers diff --git a/gluon/main.py b/gluon/main.py index c3f63969..026ee971 100644 --- a/gluon/main.py +++ b/gluon/main.py @@ -93,7 +93,7 @@ from gluon.globals import Request, Response, Session from gluon.compileapp import build_environment, run_models_in, \ run_controller_in, run_view_in from gluon.contenttype import contenttype -from gluon.pydal.base import BaseAdapter +from pydal.base import BaseAdapter from gluon.validators import CRYPT from gluon.html import URL, xmlescape from gluon.utils import is_valid_ip_address, getipaddrinfo diff --git a/gluon/scheduler.py b/gluon/scheduler.py index 69daf61c..342eb878 100644 --- a/gluon/scheduler.py +++ b/gluon/scheduler.py @@ -598,7 +598,7 @@ class Scheduler(MetaScheduler): def define_tables(self, db, migrate): """Defines Scheduler tables structure""" - from gluon.pydal.base import DEFAULT + from pydal.base import DEFAULT logger.debug('defining tables (migrate=%s)', migrate) now = self.now db.define_table( @@ -1316,7 +1316,7 @@ class Scheduler(MetaScheduler): have all fields == None """ - from gluon.pydal.objects import Query + from pydal.objects import Query sr, st = self.db.scheduler_run, self.db.scheduler_task if isinstance(ref, (int, long)): q = st.id == ref diff --git a/gluon/shell.py b/gluon/shell.py index 89c26e60..7add0607 100644 --- a/gluon/shell.py +++ b/gluon/shell.py @@ -28,7 +28,7 @@ from gluon.restricted import RestrictedError from gluon.globals import Request, Response, Session from gluon.storage import Storage, List from gluon.admin import w2p_unpack -from gluon.pydal.base import BaseAdapter +from pydal.base import BaseAdapter logger = logging.getLogger("web2py") diff --git a/gluon/sql.py b/gluon/sql.py index 4f282f71..c70d7295 100644 --- a/gluon/sql.py +++ b/gluon/sql.py @@ -13,10 +13,10 @@ Just for backward compatibility __all__ = ['DAL', 'Field', 'DRIVERS'] from dal import DAL, Field, SQLCustomType -from gluon.pydal.base import BaseAdapter -from gluon.pydal.drivers import DRIVERS -from gluon.pydal.objects import Table, Query, Set, Expression, Row, Rows -from gluon.pydal.helpers.classes import SQLALL +from pydal.base import BaseAdapter +from pydal.drivers import DRIVERS +from pydal.objects import Table, Query, Set, Expression, Row, Rows +from pydal.helpers.classes import SQLALL SQLDB = DAL GQLDB = DAL diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index 7e1f234b..132ea23b 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -26,11 +26,11 @@ from gluon.html import XML, SPAN, TAG, A, DIV, CAT, UL, LI, TEXTAREA, BR, IMG from gluon.html import FORM, INPUT, LABEL, OPTION, SELECT, COL, COLGROUP from gluon.html import TABLE, THEAD, TBODY, TR, TD, TH, STYLE, SCRIPT from gluon.html import URL, FIELDSET, P, DEFAULT_PASSWORD_DISPLAY -from gluon.pydal.base import DEFAULT -from gluon.pydal.objects import Table, Row, Expression -from gluon.pydal.adapters.base import CALLABLETYPES -from gluon.pydal.helpers.methods import smart_query, bar_encode, sqlhtml_validators -from gluon.pydal.helpers.classes import Reference, SQLCustomType +from pydal.base import DEFAULT +from pydal.objects import Table, Row, Expression +from pydal.adapters.base import CALLABLETYPES +from pydal.helpers.methods import smart_query, bar_encode, sqlhtml_validators +from pydal.helpers.classes import Reference, SQLCustomType from gluon.storage import Storage from gluon.utils import md5_hash from gluon.validators import IS_EMPTY_OR, IS_NOT_EMPTY, IS_LIST_OF, IS_DATE diff --git a/gluon/tools.py b/gluon/tools.py index e848f464..66516efa 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -43,7 +43,7 @@ from gluon import * from gluon.contrib.autolinks import expand_one from gluon.contrib.markmin.markmin2html import \ replace_at_urls, replace_autolinks, replace_components -from gluon.pydal.objects import Table, Row, Set, Query +from pydal.objects import Table, Row, Set, Query import gluon.serializers as serializers diff --git a/gluon/validators.py b/gluon/validators.py index cb3806f0..f8150ecd 100644 --- a/gluon/validators.py +++ b/gluon/validators.py @@ -22,7 +22,7 @@ import decimal import unicodedata from cStringIO import StringIO from gluon.utils import simple_hash, web2py_uuid, DIGEST_ALG_BY_SIZE -from gluon.pydal.objects import FieldVirtual, FieldMethod +from pydal.objects import FieldVirtual, FieldMethod regex_isint = re.compile('^[+-]?\d+$') @@ -603,7 +603,7 @@ class IS_IN_DB(Validator): if not [v for v in values if not v in self.theset]: return (values, None) else: - from gluon.pydal.adapters import GoogleDatastoreAdapter + from pydal.adapters import GoogleDatastoreAdapter def count(values, s=self.dbset, f=field): return s(f.belongs(map(int, values))).count() diff --git a/gluon/widget.py b/gluon/widget.py index 32aff00e..7d1f3903 100644 --- a/gluon/widget.py +++ b/gluon/widget.py @@ -1086,7 +1086,7 @@ def start(cron=True): print ProgramAuthor print ProgramVersion - from gluon.pydal.drivers import DRIVERS + from pydal.drivers import DRIVERS if not options.nobanner: print 'Database drivers available: %s' % ', '.join(DRIVERS)