from functools import cached_property
from onegov.election_day import _
from onegov.election_day.collections import SearchableArchivedResultCollection
from onegov.election_day.layouts import DefaultLayout
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from onegov.election_day.request import ElectionDayRequest
[docs]
class ArchiveLayout(DefaultLayout):
[docs]
model: SearchableArchivedResultCollection
def __init__(
self,
model: SearchableArchivedResultCollection,
request: 'ElectionDayRequest'
) -> None:
super().__init__(model, request)
@cached_property
@cached_property
[docs]
def link_for(self, item_type: str | None) -> str:
return self.request.link(
SearchableArchivedResultCollection(
self.request.app,
item_type=item_type))