election_day.layouts.default
Classes
Base class for protocol classes. |
|
Extends the base layout class with methods related to chameleon |
Module Contents
- class election_day.layouts.default.HasName[source]
Bases:
Protocol
Base class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).
For example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto(Protocol[T]): def meth(self) -> T: ...
- class election_day.layouts.default.DefaultLayout(model: Any, request: onegov.election_day.request.ElectionDayRequest)[source]
Bases:
onegov.core.layout.ChameleonLayout
Extends the base layout class with methods related to chameleon template rendering.
This class assumes the existance of two templates:
layout.pt -> Contains the page skeleton with headers, body and so on.
macros.pt -> Contains chameleon macros.
- docs_base_url = 'https://github.com/OneGov/onegov-cloud/blob/master/src/onegov/election_day/static/docs/api'[source]
- property principal: Canton | Municipality[source]