equal
deleted
inserted
replaced
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) |