Exemplo n.º 1
0
         views.create_item,
         name="create_item"),
    path('favorite/<int:restaurant_id>/', views.favorite, name='favorite'),
    path('list/', RestaurantListAPIView.as_view(), name="list"),
    path('detail/<int:restaurant_id>/',
         RestaurantDetailAPIView.as_view(),
         name="detail"),
    path('deleteapi/<int:restaurant_id>/',
         RestaurantDeleteAPIView.as_view(),
         name="deleteapi"),
    path('create/', RestaurantCreateAPIView.as_view(), name="create"),
    path('updateapi/<int:restaurant_id>/',
         RestaurantUpdateAPIView.as_view(),
         name="updateapi"),
    path('item/createapi/<int:restaurant_id>/',
         ItemCreateAPIView.as_view(),
         name="itemcreateapi"),
    path('api/register/', UserRegisterView.as_view(), name="api-register"),
    path('api/login/', LoginAPIView.as_view(), name="api-login"),
]

# path('burgermenu_list_page/', views.burger_menu_list),

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)

# you choose whatever url you want. views."the_function_defined_in_the views_file"
# you import the views file from the app
Exemplo n.º 2
0
 path('question/create/',
      QuestionCreateView.as_view(),
      name='api-question-create'),
 path('question/delete/<int:question_id>/',
      QuestionDeleteView.as_view(),
      name='api-question-delete'),
 path('answer/list/<int:question_id>/',
      AnswerListView.as_view(),
      name='api-answer_list'),
 path('answer/create/',
      AnswerCreateView.as_view(),
      name='api-answer-create'),
 path('answer/delete/<int:answer_id>/',
      AnswerDeleteView.as_view(),
      name='api-answer-delete'),
 path('register/', UserRegisterView.as_view(), name='api-register'),
 path('login/', LoginAPIView.as_view(), name='api-login'),
 path('follow/category/',
      FollowCategoryCreateView.as_view(),
      name='api-follow-category'),
 path('follow/category/list/<int:category_id>/',
      FollowCategoryListView.as_view(),
      name='api-follow-category-list'),
 path('followed/categories/list/<int:follower_id>/',
      FollowedCategoriesListView.as_view(),
      name='api-followed-categories-list'),
 path('follow/question/',
      FollowQuestionCreateView.as_view(),
      name='api-follow-question'),
 path('follow/question/list/<int:question_id>/',
      FollowQuestionListView.as_view(),
Exemplo n.º 3
0
router.register('user_device', UserDeviceViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('phone_verification/', PhoneVerificationView.as_view()),
    path('token_verification/', TokenVerificationView.as_view()),
    path('auth/', CrowdfitObtainAuthToken.as_view()),
    path('register/', CrowdfitRegisterView.as_view()),
    path('create_user/', CrowdfitRegisterView.as_view()),
    path('upload_doc_file/', UploadUserDocumentFileView.as_view()),
    path('delete_doc_file/', DeleteUserDocumentFileView.as_view()),
    path('update_doc_file/', UpdateUserDocumentFileView.as_view()),
    path('update_user/', CrowdfitUpdateUserView.as_view()),
    path('register_ceo/', CEORegisterView.as_view()),
    path('register_staff/', StaffRegisterView.as_view()),
    path('register_user/', UserRegisterView.as_view()),
    path('apartment_existed/', IsApartmentExistView.as_view()),
    path('update_apartment/', UpdateApartmentView.as_view()),
    path('delete_apartment/', DeleteApartmentView.as_view()),
    path('create_dep_role/', CreateDepartmentRoleView.as_view()),
    # path('delete_dep_role/', DeleteDepartmentRoleView.as_view()),
    path('delete_dep_role/<int:dep_role_id>/',
         DeleteDepartmentRoleView.as_view()),
    path('approve_ceo/', ApproveCEOView.as_view()),
    path('approve_staff/', ApproveStaffView.as_view()),
    path('approve_user/', ApproveUserView.as_view()),
    path('approve_user/', ApproveUserView.as_view()),
    # https://www.django-rest-framework.org/api-guide/filtering/#filtering-against-the-url
    url(r'^list_user_role_status/(?P<user_id>\d+)/$',
        ListUserRoleStatusView.as_view()),
    url(r'^list_user_by_status/(?P<status_id>\d+)/$',
Exemplo n.º 4
0
from django.urls import path
from api.views import (UserListView, UserRegisterView, UserUpdateView,
                       PlotterListView, PlotterAddView, PlotterUpdateView,
                       TemplateAddView, PlotterDeleteView, TemplateListView,
                       TemplateUpdateView, UserDealerCreateView,
                       UserDealerUpdateView, UserDealerListView,
                       UserUserCreateView, UserUserUpdateView,
                       UserUserListView, PlotterDealerList, api_root)

app_name = "api"


urlpatterns = [
    path('', api_root),
    path('user/list/', UserListView.as_view(), name='user_list'),
    path('user/registration/', UserRegisterView.as_view(),
         name='registration'),
    path('user/update/<int:pk>/', UserUpdateView.as_view(),
         name='user_update'),
    path('user/dealer/list/', UserDealerListView.as_view(),
         name='user_dealer_list'),
    path('user/dealer/create/', UserDealerCreateView.as_view(),
         name='user_dealer_create'),
    path('user/dealer/update/<int:pk>/', UserDealerUpdateView.as_view(),
         name='user_dealer_update'),

    path('user/user/list/', UserUserListView.as_view(),
         name='user_user_list'),
    path('user/user/create/', UserUserCreateView.as_view(),
         name='user_user_create'),
    path('user/user/update/<int:pk>/', UserUserUpdateView.as_view(),
Exemplo n.º 5
0
    path("favorite/<int:rest_id>/", views.favorite, name="favorite"),
    path("list/", RestaurantListAPIView.as_view()),
    path("detail/<int:rest_id>/",
         RestaurantDetailAPIView.as_view(),
         name="api-detail"),
    path("deleteit/<int:rest_id>/",
         RestaurantDeleteAPIView.as_view(),
         name="api-delete"),
    path(
        "createit/",
        RestaurantCreateAPIView.as_view(),
    ),
    path("updateit/<int:rest_id>/",
         RestaurantUpdateAPIView.as_view(),
         name="api-update"),
    path("create/item/<int:rest_id>/",
         ItemCreateAPIView.as_view(),
         name="api-create-item"),
    path("list/item/<int:rest_id>/",
         ItemListAPIView.as_view(),
         name="api-list-item"),
    path("registerit/", UserRegisterView.as_view(), name="api-register"),
    path("loginit/", LoginAPIView.as_view(), name="api-login"),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)