thread.py 597 B

123456789101112131415161718192021
  1. from django.core.urlresolvers import reverse
  2. from misago.threads.threadtypes import ThreadTypeBase
  3. class Thread(ThreadTypeBase):
  4. type_name = 'thread'
  5. def get_category_name(self, category):
  6. return category.name
  7. def get_category_absolute_url(self, category):
  8. return reverse('misago:category', kwargs={
  9. 'category_id': category.id, 'category_slug': category.slug
  10. })
  11. def get_thread_absolute_url(self, thread):
  12. return reverse('misago:thread', kwargs={
  13. 'thread_slug': thread.slug,
  14. 'thread_id': thread.id
  15. })