look for dal in packages by default

This commit is contained in:
mdipierro
2016-07-05 08:35:42 -05:00
parent d9c2f778ee
commit c5bd7ca25d
4 changed files with 5 additions and 8 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ __all__ = ['A', 'B', 'BEAUTIFY', 'BODY', 'BR', 'CAT', 'CENTER', 'CLEANUP', 'CODE
import os import os
import sys import sys
try: try:
sys.path.append(os.path.join( sys.path.insert(1,os.path.join(
os.path.dirname(os.path.abspath(__file__)), "packages", "dal")) os.path.dirname(os.path.abspath(__file__)), "packages", "dal"))
import pydal import pydal
sys.modules['pydal'] = pydal sys.modules['pydal'] = pydal
except ImportError: except ImportError:
+2 -4
View File
@@ -26,8 +26,7 @@ def api():
'DELETE':{'query':None}, 'DELETE':{'query':None},
}, },
} }
return Collection(db).process(request,response,policies) return Collection(db).process(request, response, policies)
""" """
__all__ = ['Collection'] __all__ = ['Collection']
@@ -226,8 +225,7 @@ class Collection(object):
id = row.id id = row.id
for name in ('slug','fullname','title','name'): for name in ('slug','fullname','title','name'):
if name in row: if name in row:
href = URL(args=(tablename,id,IS_SLUG.urlify(row[name] or '')), href = URL(args=(tablename,id),scheme=True)
scheme=True)
break break
else: else:
href = URL(args=(tablename,id),scheme=True) href = URL(args=(tablename,id),scheme=True)
-1
View File
@@ -15,7 +15,6 @@ from pydal import Field
from pydal.objects import Row, Rows, Table, Query, Set, Expression from pydal.objects import Row, Rows, Table, Query, Set, Expression
from pydal import SQLCustomType, geoPoint, geoLine, geoPolygon from pydal import SQLCustomType, geoPoint, geoLine, geoPolygon
def _default_validators(db, field): def _default_validators(db, field):
""" """
Field type validation, using web2py's validators mechanism. Field type validation, using web2py's validators mechanism.