org.models.external_link
¶
Module Contents¶
Classes¶
An Object appearing in some other collection |
|
Abstract base class for generic types. |
- 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
- property model_class: type[ExternalLink][source]¶
- 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]¶
- classmethod target(external_link: ExternalLink) type[onegov.core.collection.GenericCollection[Any]] [source]¶
- query() Query[ExternalLink] [source]¶
- classmethod for_model(session: sqlalchemy.orm.Session, model_class: type[onegov.form.FormCollection | onegov.reservation.ResourceCollection], **kwargs: Any) typing_extensions.Self [source]¶
It would be better to use the tablename, but the collections do not always implement the property model_class.