def orientation_code(cls): # @NoSelf
'''returns the sql expression returning the third 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, 3, 1)
#return case([(func.length(cls.channel) == 3, func.substr(cls.channel, 3, 1))], else_=null())
评论列表
文章目录