diff options
author | luxagraf <sng@luxagraf.net> | 2015-12-07 20:19:06 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2015-12-07 20:19:06 -0500 |
commit | 6ad212ae8a542e93d173c2b8e6efcd68109380c8 (patch) | |
tree | a0ed068b994e40373a506196d57e48fdd673e6a2 /app/resume | |
parent | e4a7f290d373427c36d7925e7381aadf16524936 (diff) |
added ability to edit resume landing and cv from pages app
Diffstat (limited to 'app/resume')
-rw-r--r-- | app/resume/urls.py | 9 | ||||
-rw-r--r-- | app/resume/views.py | 10 |
2 files changed, 7 insertions, 12 deletions
diff --git a/app/resume/urls.py b/app/resume/urls.py index ce9c435..bc54d36 100644 --- a/app/resume/urls.py +++ b/app/resume/urls.py @@ -22,13 +22,8 @@ urlpatterns = [ name="live-redirect" ), url( - r'^(?P<slug>[-\w]+)$', + r'^(?P<path>[-\w]+)(?:/(?P<slug>[-\w]+))$', views.PageView.as_view(), - name="cv" - ), - url( - r'^$', - views.BaseView.as_view(), - name="intro" + name="pages" ), ] diff --git a/app/resume/views.py b/app/resume/views.py index 7e5de14..d7230f7 100644 --- a/app/resume/views.py +++ b/app/resume/views.py @@ -30,11 +30,11 @@ class PageView(DetailView): slug_field = "slug" def get_queryset(self): - return Page.objects.filter(path__startswith=self.kwargs['slug']) + try: + return Page.objects.get(path__startswith=self.kwargs['path']) + except: + return Page.objects.get(path__startswith=self.kwargs['path'],slug=self.kwargs['slug']) + def get_template_names(self): return ["details/%s.html" % self.object.slug, 'details/page.html'] - - -class BaseView(TemplateView): - template_name = "archives/resume.html" |