2017-10-24 21:01:52 -04:00
|
|
|
from django.shortcuts import render
|
|
|
|
from .models import Entry
|
|
|
|
|
|
|
|
|
|
|
|
def index(request, kind):
|
|
|
|
entries = Entry.objects.filter(kind=kind.id)
|
|
|
|
return render(request, 'entries/index.html', {
|
|
|
|
'entries': entries,
|
|
|
|
'title': kind.plural
|
|
|
|
})
|
2017-10-24 21:31:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
def entry(request, id, slug=None):
|
|
|
|
entry = Entry.objects.get(pk=id)
|
|
|
|
return render(request, 'entries/entry.html', {
|
|
|
|
'entry': entry,
|
2017-10-24 23:04:22 -04:00
|
|
|
'title': entry.name or entry.content,
|
|
|
|
'meta': entry.as_meta(request)
|
2017-10-24 21:31:08 -04:00
|
|
|
})
|