swissvotes.layouts.default
Classes
Module Contents
- class swissvotes.layouts.default.DefaultLayout(model: Any, request: onegov.swissvotes.request.SwissvotesRequest)[source]
Bases:
onegov.core.layout.ChameleonLayout- property page_id: str[source]
The unique page id of the rendered page, used as the id attribute on the body element for CSS/JS.
- format_bfs_number(number: decimal.Decimal) str[source]
Hide the decimal places if there are none (simple votes).
- format_number(number: numbers.Number | decimal.Decimal | float | str | None, decimal_places: int | None = None, padding: str | int = '') str[source]
Takes the given numer and formats it according to locale.
If the number is an integer, the default decimal places are 0, otherwise 2.
Overwrites parent class to use “.” instead of “,” for fr_CH locale as would be returned by babel.