From 5be880ce1fabeb5eb4f1254f74c0212d1b71892b Mon Sep 17 00:00:00 2001 From: luxagraf Date: Thu, 27 Jul 2023 10:54:16 -0500 Subject: deals: made a bookmarklet to generate deal code markdown --- app/deals/templates/deals/deal_code.html | 58 ++++++++++++++++++++++++++++++++ app/deals/urls.py | 5 +++ app/deals/views.py | 5 +++ 3 files changed, 68 insertions(+) create mode 100644 app/deals/templates/deals/deal_code.html diff --git a/app/deals/templates/deals/deal_code.html b/app/deals/templates/deals/deal_code.html new file mode 100644 index 0000000..2ab33e2 --- /dev/null +++ b/app/deals/templates/deals/deal_code.html @@ -0,0 +1,58 @@ +{% load humanize %} + + + + + +Copy Markdown + + + + + + diff --git a/app/deals/urls.py b/app/deals/urls.py index 8ca1fca..277e1c4 100644 --- a/app/deals/urls.py +++ b/app/deals/urls.py @@ -5,6 +5,11 @@ from . import views app_name = "deals" urlpatterns = [ + path( + r'deal', + views.GenerateDealCodeView.as_view(), + name="code" + ), path( r'mydeals', views.MyDealListView.as_view(), diff --git a/app/deals/views.py b/app/deals/views.py index 10b02c9..bf0a4c8 100644 --- a/app/deals/views.py +++ b/app/deals/views.py @@ -1,4 +1,5 @@ from django.views.generic import DetailView, ListView +from django.views.generic.base import TemplateView from .models import Deal, MyDeal @@ -12,3 +13,7 @@ class MyDealListView(ListView): class MyDealLapListView(ListView): model = MyDeal queryset = MyDeal.objects.filter(asin="newbest") + + +class GenerateDealCodeView(TemplateView): + template_name = "deals/deal_code.html" -- cgit v1.2.3-70-g09d2