summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2018-02-03 08:03:45 -0600
committerluxagraf <sng@luxagraf.net>2018-02-03 08:03:45 -0600
commit31b07974cddc8843bab58f5b3e3a6bac9b529433 (patch)
tree1d06166d1f1775a49cd8ac0d14d0f9ca8e111d8d /app
parent76bb858208c37c737d9ee99442e8772ca0871f80 (diff)
finished up notes app and made it live
Diffstat (limited to 'app')
-rw-r--r--app/sketches/models.py2
-rw-r--r--app/sketches/urls.py12
-rw-r--r--app/sketches/views.py2
3 files changed, 8 insertions, 8 deletions
diff --git a/app/sketches/models.py b/app/sketches/models.py
index 0af28ad..22522bd 100644
--- a/app/sketches/models.py
+++ b/app/sketches/models.py
@@ -29,7 +29,7 @@ class Sketch(models.Model):
return self.title
def get_absolute_url(self):
- return reverse("sketch:detail", kwargs={"year": self.pub_date.year, "month": self.pub_date.strftime("%m"), "slug": self.slug})
+ return reverse("sketches:detail", kwargs={"year": self.pub_date.year, "month": self.pub_date.strftime("%m"), "slug": self.slug})
@property
def region(self):
diff --git a/app/sketches/urls.py b/app/sketches/urls.py
index 4bade9b..6554cef 100644
--- a/app/sketches/urls.py
+++ b/app/sketches/urls.py
@@ -1,10 +1,15 @@
-from django.urls import path
+from django.urls import path, re_path
from . import views
app_name = "sketches"
urlpatterns = [
+ re_path(
+ r'(?P<year>[0-9]{4})/$',
+ views.SketchYearArchiveView.as_view(),
+ name="list_year"
+ ),
path(
r'',
views.SketchListView.as_view(),
@@ -31,9 +36,4 @@ urlpatterns = [
views.SketchMonthArchiveView.as_view(month_format='%m'),
name="list_month"
),
- path(
- r'<int:year>/',
- views.SketchYearArchiveView.as_view(),
- name="list_year"
- ),
]
diff --git a/app/sketches/views.py b/app/sketches/views.py
index d6d548b..b696932 100644
--- a/app/sketches/views.py
+++ b/app/sketches/views.py
@@ -11,7 +11,7 @@ class SketchListView(PaginatedListView):
Return a list of Notes in reverse chronological order
"""
queryset = Sketch.objects.all().order_by('-pub_date')
- template_name = "archives/notes.html"
+ template_name = "archives/sketches.html"
class SketchDetailView(DetailView):