org.models.external_link
Classes
An Object appearing in some other collection |
|
Abstract base class for generic types. |
Module Contents
- class org.models.external_link.ExternalLink[source]
Bases:
onegov.core.orm.Base
,onegov.core.orm.mixins.ContentMixin
,onegov.core.orm.mixins.TimestampMixin
,onegov.org.models.AccessExtension
,onegov.search.SearchableContent
An Object appearing in some other collection that features a lead and text but points to some external url.
- class org.models.external_link.ExternalLinkCollection(session: sqlalchemy.orm.Session, member_of: str | None = None, group: str | None = None, type: str | None = None)[source]
Bases:
onegov.core.collection.GenericCollection
[ExternalLink
]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
- static translatable_name(model_class: type[object]) str [source]
Most collections have a base model whose name can be guessed from the collection name.
- classmethod collection_by_name() dict[str, type[onegov.core.collection.GenericCollection[Any]]] [source]
- property model_class: type[ExternalLink][source]
- classmethod target(external_link: ExternalLink) type[onegov.core.collection.GenericCollection[Any]] [source]
- query() sqlalchemy.orm.Query[ExternalLink] [source]