org.models.page
Classes
Defines a generic page. |
|
Defines a generic page. |
|
Abstract base class for generic types. |
Module Contents
- class org.models.page.Topic(title: str, parent: Self | None = None, **kwargs: Any)[source]
Bases:
onegov.page.Page
,onegov.org.models.traitinfo.TraitInfo
,onegov.search.SearchableContent
,onegov.org.models.extensions.AccessExtension
,onegov.org.models.extensions.PublicationExtension
,onegov.org.models.extensions.VisibleOnHomepageExtension
,onegov.org.models.extensions.InheritableContactExtension
,onegov.org.models.extensions.ContactHiddenOnPageExtension
,onegov.org.models.extensions.PeopleShownOnMainPageExtension
,onegov.org.models.extensions.PersonLinkExtension
,onegov.org.models.extensions.CoordinatesExtension
,onegov.org.models.extensions.ImageExtension
,onegov.org.models.extensions.GeneralFileLinkExtension
,onegov.org.models.extensions.SidebarLinksExtension
Defines a generic page.
- property es_skip: bool[source]
Returns True if the indexing of this specific model instance should be skipped.
- property es_public: bool[source]
Returns True if the model is available to be found by the public. If false, only editors/admins will see this object in the search results.
- property paste_target: Topic | News[source]
Returns the page that should be used as parent for the content pasting if paste is called on the current page (self).
This is usually just self. If the paste action should put the content alongside the current page, it would be the parent.
- property allowed_subtraits: tuple[str, Ellipsis][source]
Returns a list of traits that this page may contain.
- class org.models.page.News(title: str, parent: Self | None = None, **kwargs: Any)[source]
Bases:
onegov.page.Page
,onegov.org.models.traitinfo.TraitInfo
,onegov.search.SearchableContent
,onegov.org.models.extensions.NewsletterExtension
,onegov.org.models.extensions.AccessExtension
,onegov.org.models.extensions.PublicationExtension
,onegov.org.models.extensions.VisibleOnHomepageExtension
,onegov.org.models.extensions.InheritableContactExtension
,onegov.org.models.extensions.ContactHiddenOnPageExtension
,onegov.org.models.extensions.PeopleShownOnMainPageExtension
,onegov.org.models.extensions.PersonLinkExtension
,onegov.org.models.extensions.CoordinatesExtension
,onegov.org.models.extensions.ImageExtension
,onegov.org.models.extensions.GeneralFileLinkExtension
,onegov.org.models.extensions.DeletableContentExtension
Defines a generic page.
- property es_public: bool[source]
Returns True if the model is available to be found by the public. If false, only editors/admins will see this object in the search results.
- property absorb: str[source]
Alias for
path
. This is a convenience feature for Morepath if a path is absorbed.See https://morepath.readthedocs.org/en/latest/paths_and_linking.html?highlight=absorb#absorbing
- property paste_target: Topic | News[source]
Returns the page that should be used as parent for the content pasting if paste is called on the current page (self).
This is usually just self. If the paste action should put the content alongside the current page, it would be the parent.
- property allowed_subtraits: tuple[str, Ellipsis][source]
Returns a list of traits that this page may contain.
- is_supported_trait(trait: str) bool [source]
Returns true if the given trait is supported by this type This doesn’t mean that the trait may be added to this page, it serves as a simple sanity check, returning True if the combination of the type and the trait make any sense at all.
- get_form_class(trait: str, action: str, request: onegov.org.request.OrgRequest) type[onegov.form.Form | onegov.org.forms.PageForm] [source]
Returns the form class for the given trait, action.
- class org.models.page.AtoZPages(request: onegov.org.request.OrgRequest)[source]
Bases:
onegov.org.models.atoz.AtoZ
[Topic
]Abstract base class for generic types.
A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:
class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc.
This class can then be used as follows:
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default