我正在使用django-tagging,我得到了一个tag对象数组。确定给定标签是否在其中的最佳方法是什么?
def is_new (self):
tags = Tag.objects.get_for_object(self)
tagged = False
for tag in tags:
if tag = 'new':
tagged = True
return tagged发布于 2011-07-13 04:08:32
tags = Tag.objects.get_for_object(self)
if 'new' in tags:
return Truehttps://stackoverflow.com/questions/6670220
复制相似问题