server/test/data/site_cubicweb.py
author Alexandre Fayolle <alexandre.fayolle@logilab.fr>
Mon, 05 Apr 2010 09:06:16 +0200
branchstable
changeset 5145 bfa4d775219f
parent 4848 41f84eea63c9
child 5421 8167de96c523
permissions -rw-r--r--
added information about the naming conventions in schema.py also: * some typo fix * note about ObjectRelation soon being deprecated * clarified a few hazy points

"""

:organization: Logilab
:copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
"""

from logilab.database import FunctionDescr
from logilab.database.sqlite import register_sqlite_pyfunc
from rql.utils import register_function

try:
    class DUMB_SORT(FunctionDescr):
        supported_backends = ('sqlite',)

    register_function(DUMB_SORT)
    def dumb_sort(something):
        return something
    register_sqlite_pyfunc(dumb_sort)
except:
    # already registered
    pass