Get get_absolute_url in the correct place

This commit is contained in:
Sam Wenham 2019-02-25 23:07:20 +00:00
parent 77a6015ad6
commit 12a991920a

View File

@ -80,6 +80,9 @@ def expedition(request, expeditionname):
message = LoadLogbookForExpedition(expedition)
return render_with_context(request,'expedition.html', {'expedition': expedition, 'expeditions':expeditions, 'personexpeditiondays':personexpeditiondays, 'message':message, 'settings':settings, 'dateditems': dateditems })
def get_absolute_url(self):
return ('expedition', (expedition.year))
class ExpeditionListView(ListView):
model = Expedition
@ -89,9 +92,6 @@ class ExpeditionListView(ListView):
context['now'] = timezone.now()
return context
def get_absolute_url(self):
return ('expedition', (expedition.year))
def person(request, first_name='', last_name='', ):
this_person = Person.objects.get(first_name = first_name, last_name = last_name)