def get_index_text(self): # We need to index the name, and also the name without # hard-to-type characters. def str2(s): return s if s != None else "" import unicodedata n = self.name_no_details().replace(u"\u201c", " ").replace(u"\u201d", " ") r = n + "\n" + \ u"".join(c for c in unicodedata.normalize('NFKD', n) if not unicodedata.combining(c)) + "\n" + \ str2(self.most_recent_role_state()) + " " + str2(statenames.get(self.most_recent_role_state())) return r