2018-03-06 23:46:21 -05:00
|
|
|
from annoying.decorators import render_to
|
2018-03-07 22:13:45 -05:00
|
|
|
from django.shortcuts import redirect, get_object_or_404
|
2018-03-06 23:46:21 -05:00
|
|
|
from ..models import Entry
|
|
|
|
|
|
|
|
|
2023-08-10 02:52:37 -04:00
|
|
|
@render_to("entries/entry.html")
|
2018-03-07 21:49:02 -05:00
|
|
|
def entry(request, kind, id, slug=None):
|
2018-03-07 22:13:45 -05:00
|
|
|
entry = get_object_or_404(Entry, pk=id)
|
2018-03-06 23:46:21 -05:00
|
|
|
if request.path != entry.url:
|
|
|
|
return redirect(entry.url, permanent=True)
|
|
|
|
return {
|
2023-08-10 02:52:37 -04:00
|
|
|
"entry": entry,
|
|
|
|
"title": entry.title,
|
2018-03-06 23:46:21 -05:00
|
|
|
}
|