def instrument_code(cls): # @NoSelf
'''returns the sql expression returning the second letter of the channel field,
or NULL if the latter has not length 3'''
# return an sql expression matching the last char or None if not three letter channel
return substr(cls.channel, 2, 1)
# return case([(func.length(cls.channel) == 3, func.substr(cls.channel, 2, 1))], else_=null())
评论列表
文章目录