api.py 482 B

123456789101112
  1. from misago.core.apirouter import MisagoApiRouter
  2. from ..api.attachments import AttachmentViewSet
  3. from ..api.threadposts import ThreadPostsViewSet
  4. from ..api.threads import ThreadViewSet
  5. router = MisagoApiRouter()
  6. router.register(r'attachments', AttachmentViewSet, base_name='attachment')
  7. router.register(r'threads', ThreadViewSet, base_name='thread')
  8. router.register(r'threads/(?P<thread_pk>[^/.]+)/posts', ThreadPostsViewSet, base_name='thread-post')
  9. urlpatterns = router.urls