def _url_patterns_installed(): # This module can use normal Django urls.py URLs, or mount the "FaqPage" in the page tree. # Check whether the URLs are installed, so the `sitemap.xml` can be generated nevertheless. # This issue will pop up elsewhere too, so there is no need to raise an error here. try: faq_reverse('faqcategory_detail', kwargs={'slug': 'category'}, ignore_multiple=True) except NoReverseMatch: return False else: return True
def location(self, question): """Return url of an question.""" return faq_reverse('faqquestion_detail', kwargs={ 'cat_slug': question.category.slug, 'slug': question.slug }, ignore_multiple=True)
def default_url(self): """ The internal implementation of :func:`get_absolute_url`. This function can be used when overriding :func:`get_absolute_url` in the settings. For example:: ABSOLUTE_URL_OVERRIDES = { 'fluent_faq.FaqQuestion': lambda o: "http://example.com" + o.default_url } """ with switch_language(self): root = faq_reverse('faqquestion_index', ignore_multiple=True, language_code=self.get_current_language()) return root + self.get_relative_url()
def location(self, category): """Return url of an category.""" return faq_reverse('faqcategory_detail', kwargs={'slug': category.slug}, ignore_multiple=True)
def location(self, question): """Return url of an question.""" return faq_reverse('faqquestion_detail', kwargs={'cat_slug': question.category.slug, 'slug': question.slug}, ignore_multiple=True)