org.models.extensions
Attributes
Classes
Base class for protocol classes. |
|
Extends classes based on |
|
Extends any class that has a meta dictionary field with the ability to |
|
Extends any class that has a data dictionary field with the ability |
|
Extends any class that has a meta dictionary field with the ability to |
|
Common base class for extensions that add a contact field. |
|
Extends any class that has a content dictionary field with a simple |
|
Extends any class that has a content dictionary field with a simple |
|
Extends any class that has a content dictionary field with a simple |
|
Extends any class that has a content dictionary field with a simple |
|
Extends classes based on |
|
A person. |
|
Extends any class that has a content dictionary field with the ability |
|
Extends classes based on |
|
Extends classes based on |
|
Extends classes based on |
|
Extends classes based on |
|
Extends any class that has a files relationship to reference files from |
|
Extends classes based on |
|
Extends any class that has a meta dictionary field with the ability to |
|
Adds ability to reference photo albums (ImageSets) and show them |
Functions
|
|
|
Module Contents
- class org.models.extensions.SupportsExtendForm[source]
Bases:
Protocol
Base class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).
For example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto(Protocol[T]): def meth(self) -> T: ...
- class org.models.extensions.ContentExtension[source]
Extends classes based on
onegov.core.orm.mixins.ContentMixin
with custom data that is stored in either ‘meta’ or ‘content’.- property content_extensions: Iterator[type[ContentExtension]][source]
Returns all base classes of the current class which themselves have
ContentExtension
as baseclass.
- with_content_extensions(form_class: type[onegov.form.types.FormT], request: onegov.org.request.OrgRequest, extensions: Iterable[type[SupportsExtendForm]] | None = None) type[onegov.form.types.FormT] [source]
Takes the given form and request and extends the form with all content extensions in the order in which they occur in the base class list.
In other words, extends the forms with all used extension-fields.
- class org.models.extensions.AccessExtension[source]
Bases:
ContentExtension
Extends any class that has a meta dictionary field with the ability to set one of the following access levels:
‘public’ - The default, the model is listed and accessible.
- ‘private’ - Neither listed nor accessible, except administrators
and editors.
- ‘member’ - Neither listed nor accessible except administrators, editors
and members.
‘secret’ - Not listed, but available for anyone that knows the URL.
- ‘mtan’ - The model is listed but only accessible once an mTAN has been
sent to the person and entered correctly.
- ‘secret_mtan’ - Not listed and only accessible once an mTAN has been
sent to the person and entered correctly.
see
onegov.core.security.rules.has_permission_not_logged_in()
- class org.models.extensions.CoordinatesExtension[source]
Bases:
ContentExtension
,onegov.gis.CoordinatesMixin
Extends any class that has a data dictionary field with the ability to add coordinates to it.
- class org.models.extensions.VisibleOnHomepageExtension[source]
Bases:
ContentExtension
Extends any class that has a meta dictionary field with the ability to a boolean indicating if the page should be shown on the homepage or not.
- class org.models.extensions.ContactExtensionBase[source]
Common base class for extensions that add a contact field.
- class org.models.extensions.ContactExtension[source]
Bases:
ContactExtensionBase
,ContentExtension
Extends any class that has a content dictionary field with a simple contacts field.
- class org.models.extensions.InheritableContactExtension[source]
Bases:
ContactExtensionBase
,ContentExtension
Extends any class that has a content dictionary field with a simple contacts field, that can optionally be inherited from another topic.
- class org.models.extensions.ContactHiddenOnPageExtension[source]
Bases:
ContentExtension
Extends any class that has a content dictionary field with a simple contacts field.
- class org.models.extensions.PeopleShownOnMainPageExtension[source]
Bases:
ContentExtension
Extends any class that has a content dictionary field with a simple contacts field where people will be shown on bottom of main page.
Note: Feature limited to org and town6
- class org.models.extensions.NewsletterExtension[source]
Bases:
ContentExtension
Extends classes based on
onegov.core.orm.mixins.ContentMixin
with custom data that is stored in either ‘meta’ or ‘content’.
- class org.models.extensions.PersonLinkExtension[source]
Bases:
ContentExtension
Extends any class that has a content dictionary field with the ability to reference people from
onegov.people.PersonCollection
.- property people: list[PersonWithFunction] | None[source]
Returns the people linked to this content or None.
The context specific function is temporarily stored on the
context_specific_function
attribute on each object in the resulting list. Similarly, to indicate if we want to show a particular function in the page of a person,display_function_in_person_directory
is temporarily stored on each object of the resulting list.
- get_selectable_people(request: onegov.org.request.OrgRequest) list[onegov.people.Person] [source]
Returns a list of people which may be linked.
- move_person(subject: str, target: str, direction: onegov.core.orm.abstract.MoveDirection) None [source]
Moves the subject below or above the target.
- Subject:
The key of the person to be moved.
- Target:
The key of the person above or below which the subject is moved.
- Direction:
The direction relative to the target.
- class org.models.extensions.ResourceValidationExtension[source]
Bases:
ContentExtension
Extends classes based on
onegov.core.orm.mixins.ContentMixin
with custom data that is stored in either ‘meta’ or ‘content’.
- class org.models.extensions.PublicationExtension[source]
Bases:
ContentExtension
Extends classes based on
onegov.core.orm.mixins.ContentMixin
with custom data that is stored in either ‘meta’ or ‘content’.
- class org.models.extensions.HoneyPotExtension[source]
Bases:
ContentExtension
Extends classes based on
onegov.core.orm.mixins.ContentMixin
with custom data that is stored in either ‘meta’ or ‘content’.
- class org.models.extensions.ImageExtension[source]
Bases:
ContentExtension
Extends classes based on
onegov.core.orm.mixins.ContentMixin
with custom data that is stored in either ‘meta’ or ‘content’.
- org.models.extensions._files_observer(self: GeneralFileLinkExtension, files: list[onegov.file.File], meta: set[str], publication_start: datetime | None = None, publication_end: datetime | None = None) None [source]
- org.models.extensions._content_file_link_observer(self: GeneralFileLinkExtension, content: set[str]) None [source]
- class org.models.extensions.GeneralFileLinkExtension[source]
Bases:
ContentExtension
Extends any class that has a files relationship to reference files from
onegov.org.models.file.GeneralFileCollection
.Additionally any files linked within the object’s content will be added to the explicit list of linked files and access is propagated from the owner of the link to the file.
- class org.models.extensions.SidebarLinksExtension[source]
Bases:
ContentExtension
Extends classes based on
onegov.core.orm.mixins.ContentMixin
with custom data that is stored in either ‘meta’ or ‘content’.
- class org.models.extensions.DeletableContentExtension[source]
Bases:
ContentExtension
Extends any class that has a meta dictionary field with the ability to mark the content as deletable after reaching the end date. A cronjob will periodically check for ‘deletable’ content with expired end date and delete it e.g. Directories.
- class org.models.extensions.InlinePhotoAlbumExtension[source]
Bases:
ContentExtension
Adds ability to reference photo albums (ImageSets) and show them inline at the end of the content of the page.