Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve more projects section #1020

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ repos:
files: zubhub_backend/.*\.py$

- repo: https://github.com/PyCQA/isort
rev: 5.11.5 # do not update this until our CI runner uses Python >=3.8.1
rev: 5.11.5
hooks:
- id: isort
args: ["--profile", "black"]
files: zubhub_backend/.*\.py$

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4 # do not update this until our CI runner uses Python >=3.8.1
rev: 5.0.4
hooks:
- id: flake8
# use same max-line-length as black
Expand Down
105 changes: 65 additions & 40 deletions zubhub_backend/zubhub/projects/urls.py
Original file line number Diff line number Diff line change
@@ -1,46 +1,71 @@
from django.urls import path
from .views import *

from .views import (
AddCommentAPIView,
CategoryListAPIView,
DeleteCommentAPIView,
ProjectAutocompleteAPIView,
ProjectCreateAPIView,
ProjectDeleteAPIView,
ProjectDetailsAPIView,
ProjectListAPIView,
ProjectRecommendAPIView,
ProjectSearchAPIView,
ProjectTagAutocompleteAPIView,
ProjectTagSearchAPIView,
ProjectUpdateAPIView,
SavedProjectsAPIView,
StaffPickDetailsAPIView,
StaffPickListAPIView,
ToggleLikeAPIView,
ToggleSaveAPIView,
UnpublishCommentAPIView,
)

app_name = "projects"

urlpatterns = [
path('', ProjectListAPIView.as_view(), name='list_projects'),
path('tags/autocomplete/',
ProjectTagAutocompleteAPIView.as_view(),
name='autocomplete_tags'),
path('tags/search/', ProjectTagSearchAPIView.as_view(),
name='search_tags'),
path('autocomplete/',
ProjectAutocompleteAPIView.as_view(),
name='autocomplete_projects'),
path('search/', ProjectSearchAPIView.as_view(), name='search_projects'),
path('create/', ProjectCreateAPIView.as_view(), name='create_project'),
path('<uuid:pk>/update/',
ProjectUpdateAPIView.as_view(),
name='update_project'),
path('<uuid:pk>/delete/',
ProjectDeleteAPIView.as_view(),
name='delete_project'),
path('saved/', SavedProjectsAPIView.as_view(), name="saved_projects"),
path('<uuid:pk>/toggle-like/',
ToggleLikeAPIView.as_view(),
name="toggle_like"),
path('<uuid:pk>/toggle-save/',
ToggleSaveAPIView.as_view(),
name="toggle_save"),
path('<uuid:pk>/add-comment/',
AddCommentAPIView.as_view(),
name="add_comment"),
path('<int:pk>/unpublish-comment/',
UnpublishCommentAPIView.as_view(),
name="unpublish_comment"),
path('<int:pk>/delete-comment/',
DeleteCommentAPIView.as_view(),
name="delete_comment"),
path('<uuid:pk>/', ProjectDetailsAPIView.as_view(), name='detail_project'),
path('categories/', CategoryListAPIView.as_view(), name='category'),
path('staff-picks/', StaffPickListAPIView.as_view(), name="staff_picks"),
path('staff-picks/<uuid:pk>/',
StaffPickDetailsAPIView.as_view(),
name="staff_pick_details")
path("", ProjectListAPIView.as_view(), name="list_projects"),
path(
"tags/autocomplete/",
ProjectTagAutocompleteAPIView.as_view(),
name="autocomplete_tags",
),
path("tags/search/", ProjectTagSearchAPIView.as_view(), name="search_tags"),
path(
"autocomplete/",
ProjectAutocompleteAPIView.as_view(),
name="autocomplete_projects",
),
path("search/", ProjectSearchAPIView.as_view(), name="search_projects"),
path("create/", ProjectCreateAPIView.as_view(), name="create_project"),
path("<uuid:pk>/update/", ProjectUpdateAPIView.as_view(), name="update_project"),
path("<uuid:pk>/delete/", ProjectDeleteAPIView.as_view(), name="delete_project"),
path("saved/", SavedProjectsAPIView.as_view(), name="saved_projects"),
path("<uuid:pk>/toggle-like/", ToggleLikeAPIView.as_view(), name="toggle_like"),
path("<uuid:pk>/toggle-save/", ToggleSaveAPIView.as_view(), name="toggle_save"),
path("<uuid:pk>/add-comment/", AddCommentAPIView.as_view(), name="add_comment"),
path(
"<int:pk>/unpublish-comment/",
UnpublishCommentAPIView.as_view(),
name="unpublish_comment",
),
path(
"<int:pk>/delete-comment/",
DeleteCommentAPIView.as_view(),
name="delete_comment",
),
path("<uuid:pk>/", ProjectDetailsAPIView.as_view(), name="detail_project"),
path(
"<uuid:pk>/recommend/",
ProjectRecommendAPIView.as_view(),
name="recommend_projects",
),
path("categories/", CategoryListAPIView.as_view(), name="category"),
path("staff-picks/", StaffPickListAPIView.as_view(), name="staff_picks"),
path(
"staff-picks/<uuid:pk>/",
StaffPickDetailsAPIView.as_view(),
name="staff_pick_details",
),
]
Loading
Loading