def value_for(self, association):
value = str(self.prefix)
try:
if self.prop:
val = str(eval("association."+self.prop))
else:
val = str(self.value)
if 'accents' in self.options:
val = ''.join((c for c in unicodedata.normalize('NFD', val) if unicodedata.category(c) != 'Mn'))
if 'caps' in self.options:
val = val.upper()
return value + val
except AttributeError:
return ''
评论列表
文章目录