Fixing imports for new pydal
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user