diff options
Diffstat (limited to 'app/taxonomy')
-rw-r--r-- | app/taxonomy/migrations/0002_auto_20191007_0913.py | 17 | ||||
-rw-r--r-- | app/taxonomy/models.py | 4 | ||||
-rw-r--r-- | app/taxonomy/urls.py | 13 | ||||
-rw-r--r-- | app/taxonomy/views.py | 14 |
4 files changed, 46 insertions, 2 deletions
diff --git a/app/taxonomy/migrations/0002_auto_20191007_0913.py b/app/taxonomy/migrations/0002_auto_20191007_0913.py new file mode 100644 index 0000000..fb53007 --- /dev/null +++ b/app/taxonomy/migrations/0002_auto_20191007_0913.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.6 on 2019-10-07 09:13 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('taxonomy', '0001_initial'), + ] + + operations = [ + migrations.AlterModelOptions( + name='category', + options={'verbose_name': 'Category', 'verbose_name_plural': 'Categories'}, + ), + ] diff --git a/app/taxonomy/models.py b/app/taxonomy/models.py index 18d7ae3..9479a7f 100644 --- a/app/taxonomy/models.py +++ b/app/taxonomy/models.py @@ -16,7 +16,7 @@ class LuxTag(TagBase): @cached_property def get_absolute_url(self): - return reverse("taxonomy:tags", kwargs={"slug": self.slug}) + return reverse("taxonomy:cat-detail", kwargs={"slug": self.slug}) class TaggedItems(GenericTaggedItemBase): @@ -40,4 +40,4 @@ class Category(models.Model): verbose_name_plural = _("Categories") def get_absolute_url(self): - return reverse("taxonomy:categories", kwargs={"slug": self.slug}) + return reverse("taxonomy:cat-detail", kwargs={"slug": self.slug}) diff --git a/app/taxonomy/urls.py b/app/taxonomy/urls.py new file mode 100644 index 0000000..882bd52 --- /dev/null +++ b/app/taxonomy/urls.py @@ -0,0 +1,13 @@ +from django.urls import path, re_path + +from . import views + +app_name = "taxonomy" + +urlpatterns = [ + path( + r'<slug>', + views.CategoryDetailView.as_view(), + name="cat-detail" + ), +] diff --git a/app/taxonomy/views.py b/app/taxonomy/views.py new file mode 100644 index 0000000..2d749ab --- /dev/null +++ b/app/taxonomy/views.py @@ -0,0 +1,14 @@ +from django.views.generic import ListView +from django.views.generic.detail import DetailView +from django.contrib.syndication.views import Feed +from django.urls import reverse +from django.conf import settings + +#from paypal.standard.forms import PayPalPaymentsForm + +from .models import Category + + +class CategoryDetailView(DetailView): + model = Category + slug_field = "slug" |