분류 전체보기
-
django conversation-list by FBV with ListViewProject using python/Cloning Airbnb 2021. 4. 23. 17:05
url 설정 config/urls.py urlpatterns = [ path("conversations/", include("conversations.urls", namespace="conversations")), ] conversations/urls.py from django.urls import path from . import views app_name = "conversations" urlpatterns = [ path( "conversation-list/", views.ConversationList.as_view(), name="conversation-list", ), ] templates pages/conversations/conversation_host_list.html {% extends ..
-
django conversations-list by FBVProject using python/Cloning Airbnb 2021. 4. 23. 16:55
url 설정 config/urls.py urlpatterns = [ path("conversations/", include("conversations.urls", namespace="conversations")), ] conversations/urls.py from django.urls import path from . import views app_name = "conversations" urlpatterns = [ path( "conversation-list/", views.conversationList, name="conversation-list", ), ] Client pages/conversations/conversation_host_list.html {% extends 'base.html' %..
-
django conversation-detail by CBV with DetailViewProject using python/Cloning Airbnb 2021. 4. 23. 16:38
url 설정 config/urls.py urlpatterns = [ path("conversations/", include("conversations.urls", namespace="conversations")), ] conversations/urls.py from django.urls import path from conversations import views app_name = "conversations" urlpatterns = [ path( "///", views.createConversation, name="create-conversation", ), path( "/conversation-detail/", views.ConversationDetailView.as_view(), name="con..
-
django fav-list by CBV with ListViewProject using python/Cloning Airbnb 2021. 4. 23. 16:02
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.FavsList.as_view(), name="favs"), ] CBV(Class Based View) lists/views.py CBV는 django에서 정의한 여러가지 View들을 이용한다. 그 중 ListView를 이용해서 fav-list page를 작성한다. ListView는 model을 꼭 정의해줘야 한다. 하..
-
django conversations-detail by FBVProject using python/Cloning Airbnb 2021. 4. 23. 15:38
url 설정 config/urls.py urlpatterns = [ path("conversations/", include("conversations.urls", namespace="conversations")), ] conversations/urls.py from django.urls import path from . import views app_name = "conversations" urlpatterns = [ path( "//", views.createConversation, name="create-conversation", ), path( "/conversation-detail/", views.conversationDetail, name="conversation-detail", ), ] Cli..
-
django create-conversation by FBVProject using python/Cloning Airbnb 2021. 4. 23. 15:32
url 설정 config/urls.py urlpatterns = [ path("conversations/", include("conversations.urls", namespace="conversations")), ] conversations/urls.py from django.urls import path from . import views app_name = "conversations" urlpatterns = [ path( "//", views.createConversation, name="create-conversation", ), ] Client room_detail.html {% trans "Response rate" %} : 100% {% trans "Response time : In one..
-
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..