Project using python
-
django show-list by FBVProject using python/Cloning Airbnb 2021. 4. 23. 14:35
url 설정 config/urls.py urlpatterns = [ path("lists/", include("lists.urls", namespace="lists")) ] lists/urls.py from django.urls import path from lists import views app_name = "lists" urlpatterns = [ path("favs/", views.favs, name="favs"), ] Client pages/lists/fav_list.html {% extends 'base.html' %} {% block page_title %} Favs {% endblock page_title %} {% block content %} {% include 'mixins/room_..
-
django toggle-list by FBVProject using python/Cloning Airbnb 2021. 4. 23. 14:11
url 설정 config/urls.py urlpatterns = [ path("lists/", include("lists.urls", namespace="lists")) ] lists/urls.py from django.urls import path from lists import views app_name = "lists" urlpatterns = [ path("/toggle-list/", views.toggleList, name="toggle-list"), ] template tags on_favs 원하는 방을 나의 찜 목록에 추가 했는지의 여부를 판단한다. from django import template from lists import models as list_models register = t..
-
django delete-review by FBV with axiosProject using python/Cloning Airbnb 2021. 3. 18. 09:51
url 설정 config/urls.py urlpatterns = [ path("reviews/", include("reviews.urls", namespace="reviews")) ] reviews/urls.py from django.urls import path from reviews import views app_name = "reviews" urlpatterns = [ path("//delete/", views.deleteReview, name="delete") ] Client review.html {% for review in room.reviews.all %} {% if review.user.avatar %} {% else %} {{review.user.first_name|first|upper}..
-
django update-review with axiosProject using python/Cloning Airbnb 2021. 3. 18. 09:10
url 설정 config/urls.py urlpatterns = [ path("reviews/", include("reviews.urls", namespace="reviews")) ] reviews/urls.py from django.urls import path from reviews import views app_name = "reviews" urlpatterns = [ path("//update/", views.updateReview, name="update") ] Client review.html {% for review in room.reviews.all %} {% if review.user.avatar %} {% else %} {{review.user.first_name|first|upper}..
-
django create-review by FBVProject using python/Cloning Airbnb 2021. 3. 18. 04:58
url 설정 config/urls.py urlpatterns = [ path("reviews/", include("reviews.urls", namespace="reviews")) ] reviews/urls.py from django.urls import path from reviews import views app_name = "reviews" urlpatterns = [ path("/create/", views.createReview, name="create") ] FBV(Function Based View) reviews/views.py # reviews/views.py from django.shortcuts import redirect, reverse from django.contrib impor..
-
django cancel reservation by FBVProject using python/Cloning Airbnb 2021. 3. 17. 10:22
url 설정 config/urls.py urlpatterns = [ path("reservations/", include("reservations.urls", namespace="reservations")) ] reservations/urls.py from django.urls import path from reservations import views app_name = "reservations" urlpatterns = [ path("/cancel/", views.cancelReservation, name="cancel") ] FBV(Function Based View) reservations/views.py # reservations/views.py from django.shortcuts impor..
-
django confirm reservation by FBVProject using python/Cloning Airbnb 2021. 3. 17. 10:15
url 설정 config/urls.py urlpatterns = [ path("reservations/", include("reservations.urls", namespace="reservations")) ] reservations/urls.py from django.urls import path from reservations import views app_name = "reservations" urlpatterns = [ path("/confirm/", views.confirmReservation, name="confirm") ] FBV(Function Based View) reservations/views.py # reservations/views.py from django.shortcuts im..
-
django reservation-list on room in host by CBV with ListViewProject using python/Cloning Airbnb 2021. 3. 17. 09:26
url 설정 config/urls.py urlpatterns = [ path("rooms/", include("rooms.urls", namespace="room")) ] reservations/urls.py from django.urls import path from . import views app_name = "reservations" urlpatterns = [ path( "/reservation//room-list/", views.ReservationListOnRoomView.as_view(), name="host-room-list", )] CBV(Class Based View) reservations/views.py CBV는 django에서 정의한 여러가지 View들을 이용한다. 그 중 Lis..