common/__init__.py
branchstable
changeset 2213 713e220e7425
parent 2203 efdd3a9f9028
child 4023 eae23c40627a
child 4212 ab6573088b4a
equal deleted inserted replaced
2212:201ce0d389f3 2213:713e220e7425
    16 class COMMA_JOIN(FunctionDescr):
    16 class COMMA_JOIN(FunctionDescr):
    17     supported_backends = ('postgres', 'sqlite',)
    17     supported_backends = ('postgres', 'sqlite',)
    18     rtype = 'String'
    18     rtype = 'String'
    19 
    19 
    20     @classmethod
    20     @classmethod
    21     def st_description(cls, funcnode):
    21     def st_description(cls, funcnode, mainindex, tr):
    22         return ', '.join(term.get_description()
    22         return ', '.join(sorted(term.get_description(mainindex, tr)
    23                          for term in iter_funcnode_variables(funcnode))
    23                                 for term in iter_funcnode_variables(funcnode)))
    24 
    24 
    25 register_function(COMMA_JOIN)  # XXX do not expose?
    25 register_function(COMMA_JOIN)  # XXX do not expose?
    26 
    26 
    27 
    27 
    28 class CONCAT_STRINGS(COMMA_JOIN):
    28 class CONCAT_STRINGS(COMMA_JOIN):
    39 class LIMIT_SIZE(FunctionDescr):
    39 class LIMIT_SIZE(FunctionDescr):
    40     supported_backends = ('postgres', 'sqlite',)
    40     supported_backends = ('postgres', 'sqlite',)
    41     rtype = 'String'
    41     rtype = 'String'
    42 
    42 
    43     @classmethod
    43     @classmethod
    44     def st_description(cls, funcnode):
    44     def st_description(cls, funcnode, mainindex, tr):
    45         return funcnode.children[0].get_description()
    45         return funcnode.children[0].get_description(mainindex, tr)
    46 
    46 
    47 register_function(LIMIT_SIZE)
    47 register_function(LIMIT_SIZE)
    48 
    48 
    49 
    49 
    50 class TEXT_LIMIT_SIZE(LIMIT_SIZE):
    50 class TEXT_LIMIT_SIZE(LIMIT_SIZE):