-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #295 from uchicago-cs/apis/update-game-nested-endp…
…oints Added Nested Endpoints to GET information about Game model (specifically `Categories` and `Mechanics` information)
- Loading branch information
Showing
3 changed files
with
71 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,41 @@ | ||
from django.urls import path | ||
from django.urls import include, path | ||
|
||
from . import views | ||
|
||
game_patterns = [ | ||
path("", views.GameListView.as_view(), name="api-game-list"), | ||
path("<int:pk>/", views.GameDetailView.as_view(), name="api-game-detail"), | ||
path("<int:pk>/categories/", views.GameCategoriesAPIView.as_view(), name="api-game-categories"), | ||
path("<int:pk>/mechanics/", views.GameMechanicsAPIView.as_view(), name="api-game-mechanics"), | ||
] | ||
|
||
lobby_patterns = [ | ||
path("", views.LobbyListView.as_view(), name="api-lobby-list"), | ||
path("<int:pk>/", views.LobbyDetailView.as_view(), name="api-lobby-detail"), | ||
] | ||
|
||
user_patterns = [ | ||
path("", views.UserListView.as_view(), name="api-user-list"), | ||
path("<slug:slug>/", views.UserDetailView.as_view(), name="api-user-detail"), | ||
path("<slug:slug>/groups/", views.UserGroupsView.as_view(), name="api-user-groups"), | ||
path("<int:pk>/friends/", views.UserFriendsAPIView.as_view(), name="api-user-friends"), | ||
] | ||
|
||
tournament_patterns = [ | ||
path("chat/", views.MessageView.as_view(), name="api-chat-list"), | ||
path("chat/feed/", views.MessageFeedView.as_view(), name="api-chat-detail"), | ||
] | ||
|
||
group_patterns = [ | ||
path("", views.GroupListView.as_view(), name="api-group-list"), | ||
path("<int:pk>/", views.GroupDetailView.as_view(), name="api-group-detail"), | ||
path("<int:pk>/members/", views.GroupMembersView.as_view(), name="api-group-members"), | ||
] | ||
|
||
urlpatterns = [ | ||
# GAME API URLS | ||
path("games/", views.GameListView.as_view(), name="api-game-list"), | ||
path("games/<int:pk>/", views.GameDetailView.as_view(), name="api-game-detail"), | ||
# LOBBY API URLS | ||
path("lobbies/", views.LobbyListView.as_view(), name="api-lobby-list"), | ||
path("lobbies/<int:pk>/", views.LobbyDetailView.as_view(), name="api-lobby-detail"), | ||
# USER API URLS | ||
path("users/", views.UserListView.as_view(), name="api-user-list"), | ||
path("users/<slug:slug>/", views.UserDetailView.as_view(), name="api-user-detail"), | ||
path("users/<int:pk>/friends/", views.UserFriendsAPIView.as_view(), name="api-user-friends"), | ||
path("users/<slug:slug>/groups/", views.UserGroupsView.as_view(), name="api-user-groups"), | ||
# CHAT API URLS | ||
path("tournaments/chat/", views.MessageView.as_view(), name="api-chat-list"), | ||
path("tournaments/chat/feed/", views.MessageFeedView.as_view(), name="api-chat-detail"), | ||
# GROUP API URLS | ||
path("groups/", views.GroupListView.as_view(), name="api-group-list"), | ||
path("groups/<int:pk>/", views.GroupDetailView.as_view(), name="api-group-detail"), | ||
path("groups/<int:pk>/members/", views.GroupMembersView.as_view(), name="api-group-members"), | ||
path("games/", include(game_patterns)), | ||
path("lobbies/", include(lobby_patterns)), | ||
path("users/", include(user_patterns)), | ||
path("tournaments/", include(tournament_patterns)), | ||
path("groups/", include(group_patterns)), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters