funkwhale/api/funkwhale_api/manage/urls.py

45 wiersze
1.9 KiB
Python
Czysty Zwykły widok Historia

from django.conf.urls import include, url
from funkwhale_api.common import routers
2018-06-09 13:36:16 +00:00
2018-06-10 08:55:16 +00:00
from . import views
federation_router = routers.OptionalSlashRouter()
federation_router.register(r"domains", views.ManageDomainViewSet, "domains")
library_router = routers.OptionalSlashRouter()
2019-04-17 12:17:59 +00:00
library_router.register(r"albums", views.ManageAlbumViewSet, "albums")
2019-04-19 10:05:13 +00:00
library_router.register(r"artists", views.ManageArtistViewSet, "artists")
library_router.register(r"libraries", views.ManageLibraryViewSet, "libraries")
2019-04-17 12:17:59 +00:00
library_router.register(r"tracks", views.ManageTrackViewSet, "tracks")
2019-04-19 10:05:13 +00:00
library_router.register(r"uploads", views.ManageUploadViewSet, "uploads")
moderation_router = routers.OptionalSlashRouter()
moderation_router.register(
r"instance-policies", views.ManageInstancePolicyViewSet, "instance-policies"
)
moderation_router.register(r"reports", views.ManageReportViewSet, "reports")
2020-03-18 10:57:33 +00:00
moderation_router.register(r"requests", views.ManageUserRequestViewSet, "requests")
moderation_router.register(r"notes", views.ManageNoteViewSet, "notes")
users_router = routers.OptionalSlashRouter()
2018-06-19 16:48:43 +00:00
users_router.register(r"users", views.ManageUserViewSet, "users")
users_router.register(r"invitations", views.ManageInvitationViewSet, "invitations")
other_router = routers.OptionalSlashRouter()
2019-01-03 10:47:29 +00:00
other_router.register(r"accounts", views.ManageActorViewSet, "accounts")
other_router.register(r"channels", views.ManageChannelViewSet, "channels")
other_router.register(r"tags", views.ManageTagViewSet, "tags")
2019-01-03 10:47:29 +00:00
urlpatterns = [
url(
r"^federation/",
include((federation_router.urls, "federation"), namespace="federation"),
),
2018-06-19 16:48:43 +00:00
url(r"^library/", include((library_router.urls, "instance"), namespace="library")),
url(
r"^moderation/",
include((moderation_router.urls, "moderation"), namespace="moderation"),
),
2018-06-19 16:48:43 +00:00
url(r"^users/", include((users_router.urls, "instance"), namespace="users")),
2019-01-03 10:47:29 +00:00
] + other_router.urls