server/test/data/site_cubicweb.py
changeset 5768 1e73a466aa69
parent 5424 8ecbcbff9777
child 7815 2a164a9cf81c
equal deleted inserted replaced
5766:c397819f2482 5768:1e73a466aa69
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    14 # details.
    14 # details.
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """
       
    19 
       
    20 """
       
    21 
    18 
    22 from logilab.database import FunctionDescr
    19 from logilab.database import FunctionDescr
    23 from logilab.database.sqlite import register_sqlite_pyfunc
    20 from logilab.database.sqlite import register_sqlite_pyfunc
    24 from rql.utils import register_function
    21 from rql.utils import register_function
    25 
    22 
    26 try:
    23 try:
    27     class DUMB_SORT(FunctionDescr):
    24     class DUMB_SORT(FunctionDescr):
    28         supported_backends = ('sqlite',)
    25         pass
    29 
    26 
    30     register_function(DUMB_SORT)
    27     register_function(DUMB_SORT)
    31     def dumb_sort(something):
    28     def dumb_sort(something):
    32         return something
    29         return something
    33     register_sqlite_pyfunc(dumb_sort)
    30     register_sqlite_pyfunc(dumb_sort)