no more DAL and pyDAL

This commit is contained in:
mdipierro
2015-03-20 09:11:24 -05:00
parent 29b58ff70c
commit a56c1f37ed
+9 -19
View File
@@ -10,7 +10,7 @@ Takes care of adapting pyDAL to web2py's needs
-------------------------------------------- --------------------------------------------
""" """
from pydal import DAL as pyDAL from pydal import DAL as DAL
from pydal import Field from pydal import Field
from pydal.objects import Row, Rows, Table, Query, Expression from pydal.objects import Row, Rows, Table, Query, Expression
from pydal import SQLCustomType, geoPoint, geoLine, geoPolygon from pydal import SQLCustomType, geoPoint, geoLine, geoPolygon
@@ -86,25 +86,15 @@ from gluon.utils import web2py_uuid
from gluon import sqlhtml from gluon import sqlhtml
class DAL(pyDAL): DAL.serializers = w2p_serializers
serializers = w2p_serializers DAL.validators_method = _default_validators
validators_method = _default_validators DAL.uuid = lambda x: web2py_uuid()
uuid = lambda x: web2py_uuid() DAL.representers = {
representers = { 'rows_render': sqlhtml.represent,
'rows_render': sqlhtml.represent, 'rows_xml': sqlhtml.SQLTABLE
'rows_xml': sqlhtml.SQLTABLE
} }
Field = Field DAL.Field = Field
Table = Table DAL.Table = Table
def DAL_unpickler(db_uid):
return DAL('<zombie>', db_uid=db_uid)
def DAL_pickler(db):
return DAL_unpickler, (db._db_uid,)
copyreg.pickle(DAL, DAL_pickler, DAL_unpickler)
#: add web2py contrib drivers to pyDAL #: add web2py contrib drivers to pyDAL
from pydal.drivers import DRIVERS from pydal.drivers import DRIVERS