server/test/data/site_cubicweb.py
changeset 4832 98c7760b7e9a
parent 4831 c5aec27c1bf7
child 4848 41f84eea63c9
equal deleted inserted replaced
4831:c5aec27c1bf7 4832:98c7760b7e9a
       
     1 """
       
     2 
       
     3 :organization: Logilab
       
     4 :copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
       
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
       
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
       
     7 """
       
     8 
       
     9 from logilab.db import FunctionDescr
       
    10 from logilab.db.sqlite import register_sqlite_pyfunc
       
    11 from rql.utils import register_function
       
    12 
       
    13 try:
       
    14     class DUMB_SORT(FunctionDescr):
       
    15         supported_backends = ('sqlite',)
       
    16 
       
    17     register_function(DUMB_SORT)
       
    18     def dumb_sort(something):
       
    19         return something
       
    20     register_sqlite_pyfunc(dumb_sort)
       
    21 except:
       
    22     # already registered
       
    23     pass