misc: add assignment tag to get a specific page (#28626)
This commit is contained in:
parent
4efc5d9449
commit
d35ffa3b59
|
@ -28,7 +28,7 @@ from django.template.base import TOKEN_BLOCK, TOKEN_VAR
|
|||
from django.template.defaultfilters import stringfilter
|
||||
from django.utils import dateparse
|
||||
|
||||
from combo.data.models import Placeholder
|
||||
from combo.data.models import Page, Placeholder
|
||||
from combo.public.menu import get_menu_context
|
||||
from combo.utils import NothingInCacheException, flatten_context
|
||||
from combo.apps.dashboard.models import DashboardCell, Tile
|
||||
|
@ -246,3 +246,7 @@ def name_id(user):
|
|||
# it is important to raise this so get_templated_url is aborted and no call
|
||||
# is tried with a missing user argument.
|
||||
raise VariableDoesNotExist('name_id')
|
||||
|
||||
@register.assignment_tag
|
||||
def get_page(page_slug):
|
||||
return Page.objects.get(slug=page_slug)
|
||||
|
|
Loading…
Reference in New Issue