swissvotes.collections.pages

Classes

TranslatablePageCollection

A collection of translatable content pages.

Module Contents

class swissvotes.collections.pages.TranslatablePageCollection(session: sqlalchemy.orm.Session, **kwargs: Any)[source]

Bases: onegov.core.collection.GenericCollection[onegov.swissvotes.models.TranslatablePage]

A collection of translatable content pages.

property model_class: type[onegov.swissvotes.models.TranslatablePage][source]
setdefault(id: str) onegov.swissvotes.models.TranslatablePage[source]
query() Query[TranslatablePage][source]
add(**kwargs: Any) onegov.swissvotes.models.TranslatablePage[source]

Adds a new page.

move(subject: onegov.swissvotes.models.TranslatablePage, target: onegov.swissvotes.models.TranslatablePage, direction: onegov.core.orm.abstract.MoveDirection) None[source]

Takes the given subject and moves it somehwere in relation to the target.

Subject:

The page to be moved.

Target:

The page above which or below which the subject is moved.

Direction:

The direction relative to the target. Either MoveDirection.above if the subject should be moved above the target, or MoveDirection.below if the subject should be moved below the target.