# Path: feincms/module/page/models.py
# class Page(BasePage):
#     class Meta:
#         ordering = ["tree_id", "lft"]
#         verbose_name = _("page")
#         verbose_name_plural = _("pages")
#         app_label = "page"
#         # not yet # permissions = (("edit_page", _("Can edit page metadata")),)


from feincms.module.page.models import Page


def add_page_if_missing(request):
    """
    Returns ``feincms_page`` for request.
    """

    try:
        return {"feincms_page": Page.objects.for_request(request, best_match=True)}

# Path: feincms/module/page/models.py
# class Page(BasePage):
#     class Meta:
#         ordering = ["tree_id", "lft"]
#         verbose_name = _("page")
#         verbose_name_plural = _("pages")
#         app_label = "page"
#         # not yet # permissions = (("edit_page", _("Can edit page metadata")),)


# Path: feincms/context_processors.py
from feincms.module.page.models import Page



def add_page_if_missing(request):
    """
    Returns ``feincms_page`` for request.
    """

    try:
        return {"feincms_page": Page.objects.for_request(request, best_match=True)}

    except Page.DoesNotExist: