예제 #1
0
파일: media.py 프로젝트: MechanisM/Telemeta
    def ethnic_groups(self):
        "Return the ethnic groups of the items"
        groups = []
        items = self.items.all()
        for item in items:
            if item.ethnic_group and not item.ethnic_group in groups:
                groups.append(item.ethnic_group)

        cmp = lambda a, b: unaccent_icmp(a.value, b.value)
        groups.sort(cmp)

        return groups
예제 #2
0
 def __name_cmp(obj1, obj2):
     return unaccent_icmp(obj1.name, obj2.name)