def get_absolute_url(self): return reverse2("questionnaire", self.questionnaire.pk, self.pk)
def section_links(self): section_url = "admin:questionnaire_section_change" lst = [(c.pk, c.name) for c in self.sections.all()] lst = [(reverse2(section_url, pk), name) for pk, name in lst] return ", ".join([link % c for c in lst])
def get_absolute_url(self, section=1): return reverse2("questionnaire", self.pk, section)