org.models.external_link ======================== .. py:module:: org.models.external_link Classes ------- .. autoapisummary:: org.models.external_link.ExternalLink org.models.external_link.ExternalLinkCollection Module Contents --------------- .. py:class:: ExternalLink Bases: :py:obj:`onegov.core.orm.Base`, :py:obj:`onegov.core.orm.mixins.ContentMixin`, :py:obj:`onegov.core.orm.mixins.TimestampMixin`, :py:obj:`onegov.org.models.AccessExtension`, :py:obj:`onegov.search.SearchableContent` An Object appearing in some other collection that features a lead and text but points to some external url. .. py:attribute:: __tablename__ :value: 'external_links' .. py:attribute:: fts_properties .. py:attribute:: id :type: sqlalchemy.Column[uuid.UUID] .. py:attribute:: title :type: sqlalchemy.Column[str] .. py:attribute:: url :type: sqlalchemy.Column[str] .. py:attribute:: page_image :type: onegov.core.orm.mixins.dict_property[str | None] .. py:attribute:: member_of :type: sqlalchemy.Column[str | None] .. py:attribute:: group :type: sqlalchemy.Column[str | None] .. py:attribute:: order :type: sqlalchemy.Column[str] .. py:attribute:: lead :type: onegov.core.orm.mixins.dict_property[str | None] .. py:method:: title_observer(title: str) -> None .. py:class:: ExternalLinkCollection(session: sqlalchemy.orm.Session, member_of: str | None = None, group: str | None = None, type: str | None = None) Bases: :py:obj:`onegov.core.collection.GenericCollection`\ [\ :py:obj:`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 .. py:attribute:: supported_collections .. py:attribute:: member_of :value: None .. py:attribute:: group :value: None .. py:attribute:: type :value: None .. py:method:: translatable_name(model_class: type[object]) -> str :staticmethod: Most collections have a base model whose name can be guessed from the collection name. .. py:method:: form_choices() -> tuple[tuple[str, str], Ellipsis] .. py:method:: collection_by_name() -> dict[str, type[onegov.core.collection.GenericCollection[Any]]] :classmethod: .. py:property:: model_class :type: type[ExternalLink] .. py:method:: target(external_link: ExternalLink) -> type[onegov.core.collection.GenericCollection[Any]] :classmethod: .. py:method:: query() -> sqlalchemy.orm.Query[ExternalLink] .. py:method:: for_model(session: sqlalchemy.orm.Session, model_class: type[onegov.form.FormCollection | onegov.reservation.ResourceCollection], **kwargs: Any) -> Self :classmethod: It would be better to use the tablename, but the collections do not always implement the property model_class.