lemoncurry/lemonshort/views.py

10 lines
267 B
Python
Raw Permalink Normal View History

from django.apps import apps
from django.shortcuts import get_object_or_404, redirect
from .convert import AbcIdConverter
def unshort(request, model, tiny):
entity = get_object_or_404(apps.get_model(model), pk=tiny)
return redirect(entity, permanent=True)