thread.py 923 B

123456789101112131415161718192021222324252627282930
  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,
  10. 'category_slug': category.slug,
  11. })
  12. def get_thread_absolute_url(self, thread):
  13. return '/threads/not-implemented-yet-%s/' % thread.pk
  14. def get_thread_last_post_url(self, thread):
  15. return '/threads/not-implemented-yet-%s/last/' % thread.pk
  16. def get_thread_new_post_url(self, thread):
  17. return '/threads/not-implemented-yet-%s/new/' % thread.pk
  18. def get_thread_api_subscribe_url(self, thread):
  19. return reverse('misago:api:thread-subscribe', kwargs={
  20. 'pk': thread.pk,
  21. })