org.models.ticket
Classes
Adds additional methods to the ticket, needed by the organisations |
|
Adds additional methods to the ticket, needed by the organisations |
|
Adds additional methods to the ticket, needed by the organisations |
|
Adds additional methods to the ticket, needed by the organisations |
|
Adds additional methods to the ticket, needed by the organisations |
|
Defines a generic handler, responsible for a subset of the tickets. |
|
Defines a generic handler, responsible for a subset of the tickets. |
|
Defines a generic handler, responsible for a subset of the tickets. |
|
Defines a generic handler, responsible for a subset of the tickets. |
|
Adds additional methods to the ticket, needed by the organisations |
|
Defines a generic handler, responsible for a subset of the tickets. |
Functions
|
Module Contents
- class org.models.ticket.OrgTicketMixin[source]
Adds additional methods to the ticket, needed by the organisations implementation of it. Strictly limited to things that do not belong into onegov.ticket.
- reference(request: onegov.org.request.OrgRequest) str [source]
Returns the reference which should be used wherever we talk about a ticket, but do not show it (say in an e-mail subject).
This reference should not be changed so it stays consistent.
If you want, you can override the content of the reference group, shown in brackets (see
reference_group()
).
- class org.models.ticket.FormSubmissionTicket[source]
Bases:
OrgTicketMixin
,onegov.ticket.Ticket
Adds additional methods to the ticket, needed by the organisations implementation of it. Strictly limited to things that do not belong into onegov.ticket.
- class org.models.ticket.ReservationTicket[source]
Bases:
OrgTicketMixin
,onegov.ticket.Ticket
Adds additional methods to the ticket, needed by the organisations implementation of it. Strictly limited to things that do not belong into onegov.ticket.
- class org.models.ticket.EventSubmissionTicket[source]
Bases:
OrgTicketMixin
,onegov.ticket.Ticket
Adds additional methods to the ticket, needed by the organisations implementation of it. Strictly limited to things that do not belong into onegov.ticket.
- handler: EventSubmissionHandler[source]
Returns an instance of the handler associated with this ticket.
- class org.models.ticket.DirectoryEntryTicket[source]
Bases:
OrgTicketMixin
,onegov.ticket.Ticket
Adds additional methods to the ticket, needed by the organisations implementation of it. Strictly limited to things that do not belong into onegov.ticket.
- class org.models.ticket.FormSubmissionHandler(ticket: onegov.ticket.model.Ticket, handler_id: UUID | str, handler_data: dict[str, Any])[source]
Bases:
onegov.ticket.Handler
Defines a generic handler, responsible for a subset of the tickets.
onegov.ticket is meant to be a rather generic bucket of tickets, to which varying modules submit tickets with varying content and different actionables.
Each module wanting to submit tickets needs to implement a handler with a unique id and a unique short code. The short code is added in front of the ticket number.
Tickets submitted to the database are shown in a list, without handler involvement. When a ticket is displayed, the handler is called with whatever data the handler supplied during ticket submission.
The handler then uses the handler data to access whatever data it needs to display a summary as well as links to certain actions (possibly a link to the original item, links that change the state of the ticket as well as the data associated with the handler, etc.).
- property submission: FormSubmission | None[source]
- property deleted: bool[source]
Returns true if the underlying model was deleted. It is best to never let that happen, as we want tickets to stay around forever.
However, this can make sense in certain scenarios. Note that if you do delete your underlying model, make sure to call
onegov.ticket.models.Ticket.create_snapshot()
beforehand!
- property title: str[source]
Returns the title of the ticket. If this title may change over time, the handler must call
self.refresh()
when there’s a change.
- property subtitle: None[source]
Returns the subtitle of the ticket. If this title may change over time, the handler must call
self.refresh()
when there’s a change.
- property group: str[source]
Returns the group of the ticket. If this group may change over time, the handler must call
self.refresh()
when there’s a change.
- property extra_data: list[str][source]
An array of string values which are indexed in elasticsearch when the ticket is stored there.
- property undecided: bool[source]
Returns true if there has been no decision about the subject of this handler.
For example, if a reservation ticket has been accepted, but the reservation has been neither confirmed nor cancelled, the ticket can be seen as undecided.
This is an optional flag that may be implemented by handlers. If a ticket is undecided, the UI might show a special icon and it might warn the user if he closes the ticket without making a decision.
By default, the ticket is assumed to be decided for backwards compatibility and for tickets where this does not make sense (a simple form submission may not have any way of knowing if there has been a decision or not).
- get_summary(request: onegov.org.request.OrgRequest) markupsafe.Markup [source]
Returns the summary of the current ticket as a html string.
- get_links(request: onegov.org.request.OrgRequest) list[onegov.core.elements.Link | onegov.core.elements.LinkGroup] [source]
Returns the links associated with the current ticket in the following format:
[ ('Link Title', 'http://link'), ('Link Title 2', 'http://link2'), ]
If the links are not tuples, but callables, they will be called with the request which should return the rendered link.
- class org.models.ticket.ReservationHandler(ticket: onegov.ticket.model.Ticket, handler_id: UUID | str, handler_data: dict[str, Any])[source]
Bases:
onegov.ticket.Handler
Defines a generic handler, responsible for a subset of the tickets.
onegov.ticket is meant to be a rather generic bucket of tickets, to which varying modules submit tickets with varying content and different actionables.
Each module wanting to submit tickets needs to implement a handler with a unique id and a unique short code. The short code is added in front of the ticket number.
Tickets submitted to the database are shown in a list, without handler involvement. When a ticket is displayed, the handler is called with whatever data the handler supplied during ticket submission.
The handler then uses the handler data to access whatever data it needs to display a summary as well as links to certain actions (possibly a link to the original item, links that change the state of the ticket as well as the data associated with the handler, etc.).
- property submission: FormSubmission | None[source]
- property deleted: bool[source]
Returns true if the underlying model was deleted. It is best to never let that happen, as we want tickets to stay around forever.
However, this can make sense in certain scenarios. Note that if you do delete your underlying model, make sure to call
onegov.ticket.models.Ticket.create_snapshot()
beforehand!
- property extra_data: list[str][source]
An array of string values which are indexed in elasticsearch when the ticket is stored there.
- property undecided: bool[source]
Returns true if there has been no decision about the subject of this handler.
For example, if a reservation ticket has been accepted, but the reservation has been neither confirmed nor cancelled, the ticket can be seen as undecided.
This is an optional flag that may be implemented by handlers. If a ticket is undecided, the UI might show a special icon and it might warn the user if he closes the ticket without making a decision.
By default, the ticket is assumed to be decided for backwards compatibility and for tickets where this does not make sense (a simple form submission may not have any way of knowing if there has been a decision or not).
- prepare_delete_ticket() None [source]
The handler knows best what to do when a ticket is called for deletion.
- property title: str[source]
Returns the title of the ticket. If this title may change over time, the handler must call
self.refresh()
when there’s a change.
- property subtitle: str | None[source]
Returns the subtitle of the ticket. If this title may change over time, the handler must call
self.refresh()
when there’s a change.
- property group: str | None[source]
Returns the group of the ticket. If this group may change over time, the handler must call
self.refresh()
when there’s a change.
- classmethod handle_extra_parameters(session: sqlalchemy.orm.Session, query: onegov.ticket.handler._Q, extra_parameters: dict[str, Any]) onegov.ticket.handler._Q [source]
Takes a dictionary of extra parameters and uses it to optionally modifiy the query used for the collection.
Use this to add handler-defined custom filters with extra query parameters. Only called if the collection is already limited to the given handler. If all handlers are shown in the collection, this method is not called.
If no extra paramaters were given, this method is not called.
Returns the modified or unmodified query.
- get_summary(request: onegov.org.request.OrgRequest) markupsafe.Markup [source]
Returns the summary of the current ticket as a html string.
- get_links(request: onegov.org.request.OrgRequest) list[onegov.core.elements.Link | onegov.core.elements.LinkGroup] [source]
Returns the links associated with the current ticket in the following format:
[ ('Link Title', 'http://link'), ('Link Title 2', 'http://link2'), ]
If the links are not tuples, but callables, they will be called with the request which should return the rendered link.
- class org.models.ticket.EventSubmissionHandler(ticket: onegov.ticket.model.Ticket, handler_id: UUID | str, handler_data: dict[str, Any])[source]
Bases:
onegov.ticket.Handler
Defines a generic handler, responsible for a subset of the tickets.
onegov.ticket is meant to be a rather generic bucket of tickets, to which varying modules submit tickets with varying content and different actionables.
Each module wanting to submit tickets needs to implement a handler with a unique id and a unique short code. The short code is added in front of the ticket number.
Tickets submitted to the database are shown in a list, without handler involvement. When a ticket is displayed, the handler is called with whatever data the handler supplied during ticket submission.
The handler then uses the handler data to access whatever data it needs to display a summary as well as links to certain actions (possibly a link to the original item, links that change the state of the ticket as well as the data associated with the handler, etc.).
- property deleted: bool[source]
Returns true if the underlying model was deleted. It is best to never let that happen, as we want tickets to stay around forever.
However, this can make sense in certain scenarios. Note that if you do delete your underlying model, make sure to call
onegov.ticket.models.Ticket.create_snapshot()
beforehand!
- property title: str[source]
Returns the title of the ticket. If this title may change over time, the handler must call
self.refresh()
when there’s a change.
- property subtitle: str | None[source]
Returns the subtitle of the ticket. If this title may change over time, the handler must call
self.refresh()
when there’s a change.
- property extra_data: list[str][source]
An array of string values which are indexed in elasticsearch when the ticket is stored there.
- property undecided: bool[source]
Returns true if there has been no decision about the subject of this handler.
For example, if a reservation ticket has been accepted, but the reservation has been neither confirmed nor cancelled, the ticket can be seen as undecided.
This is an optional flag that may be implemented by handlers. If a ticket is undecided, the UI might show a special icon and it might warn the user if he closes the ticket without making a decision.
By default, the ticket is assumed to be decided for backwards compatibility and for tickets where this does not make sense (a simple form submission may not have any way of knowing if there has been a decision or not).
- property group: str[source]
Returns the group of the ticket. If this group may change over time, the handler must call
self.refresh()
when there’s a change.
- get_summary(request: onegov.org.request.OrgRequest) markupsafe.Markup [source]
Returns the summary of the current ticket as a html string.
- get_links(request: onegov.org.request.OrgRequest) list[onegov.core.elements.Link | onegov.core.elements.LinkGroup] [source]
Returns the links associated with the current ticket in the following format:
[ ('Link Title', 'http://link'), ('Link Title 2', 'http://link2'), ]
If the links are not tuples, but callables, they will be called with the request which should return the rendered link.
- class org.models.ticket.DirectoryEntryHandler(ticket: onegov.ticket.model.Ticket, handler_id: UUID | str, handler_data: dict[str, Any])[source]
Bases:
onegov.ticket.Handler
Defines a generic handler, responsible for a subset of the tickets.
onegov.ticket is meant to be a rather generic bucket of tickets, to which varying modules submit tickets with varying content and different actionables.
Each module wanting to submit tickets needs to implement a handler with a unique id and a unique short code. The short code is added in front of the ticket number.
Tickets submitted to the database are shown in a list, without handler involvement. When a ticket is displayed, the handler is called with whatever data the handler supplied during ticket submission.
The handler then uses the handler data to access whatever data it needs to display a summary as well as links to certain actions (possibly a link to the original item, links that change the state of the ticket as well as the data associated with the handler, etc.).
- property submission: FormSubmission | None[source]
- property deleted: bool[source]
Returns true if the underlying model was deleted. It is best to never let that happen, as we want tickets to stay around forever.
However, this can make sense in certain scenarios. Note that if you do delete your underlying model, make sure to call
onegov.ticket.models.Ticket.create_snapshot()
beforehand!
- property title: str[source]
Returns the title of the ticket. If this title may change over time, the handler must call
self.refresh()
when there’s a change.
- property subtitle: None[source]
Returns the subtitle of the ticket. If this title may change over time, the handler must call
self.refresh()
when there’s a change.
- property group: str[source]
Returns the group of the ticket. If this group may change over time, the handler must call
self.refresh()
when there’s a change.
- property extra_data: list[str][source]
An array of string values which are indexed in elasticsearch when the ticket is stored there.
- property undecided: bool[source]
Returns true if there has been no decision about the subject of this handler.
For example, if a reservation ticket has been accepted, but the reservation has been neither confirmed nor cancelled, the ticket can be seen as undecided.
This is an optional flag that may be implemented by handlers. If a ticket is undecided, the UI might show a special icon and it might warn the user if he closes the ticket without making a decision.
By default, the ticket is assumed to be decided for backwards compatibility and for tickets where this does not make sense (a simple form submission may not have any way of knowing if there has been a decision or not).
- get_summary(request: onegov.org.request.OrgRequest) markupsafe.Markup [source]
Returns the summary of the current ticket as a html string.
- get_links(request: onegov.org.request.OrgRequest) list[onegov.core.elements.Link | onegov.core.elements.LinkGroup] [source]
Returns the links associated with the current ticket in the following format:
[ ('Link Title', 'http://link'), ('Link Title 2', 'http://link2'), ]
If the links are not tuples, but callables, they will be called with the request which should return the rendered link.
- class org.models.ticket.ChatTicket[source]
Bases:
OrgTicketMixin
,onegov.ticket.Ticket
Adds additional methods to the ticket, needed by the organisations implementation of it. Strictly limited to things that do not belong into onegov.ticket.
- class org.models.ticket.ChatHandler(ticket: onegov.ticket.model.Ticket, handler_id: UUID | str, handler_data: dict[str, Any])[source]
Bases:
onegov.ticket.Handler
Defines a generic handler, responsible for a subset of the tickets.
onegov.ticket is meant to be a rather generic bucket of tickets, to which varying modules submit tickets with varying content and different actionables.
Each module wanting to submit tickets needs to implement a handler with a unique id and a unique short code. The short code is added in front of the ticket number.
Tickets submitted to the database are shown in a list, without handler involvement. When a ticket is displayed, the handler is called with whatever data the handler supplied during ticket submission.
The handler then uses the handler data to access whatever data it needs to display a summary as well as links to certain actions (possibly a link to the original item, links that change the state of the ticket as well as the data associated with the handler, etc.).
- property deleted: bool[source]
Returns true if the underlying model was deleted. It is best to never let that happen, as we want tickets to stay around forever.
However, this can make sense in certain scenarios. Note that if you do delete your underlying model, make sure to call
onegov.ticket.models.Ticket.create_snapshot()
beforehand!
- property title: str[source]
Returns the title of the ticket. If this title may change over time, the handler must call
self.refresh()
when there’s a change.
- property subtitle: None[source]
Returns the subtitle of the ticket. If this title may change over time, the handler must call
self.refresh()
when there’s a change.
- property group: str | None[source]
Returns the group of the ticket. If this group may change over time, the handler must call
self.refresh()
when there’s a change.
- get_summary(request: onegov.org.request.OrgRequest) markupsafe.Markup [source]
Returns the summary of the current ticket as a html string.
- get_links(request: onegov.org.request.OrgRequest) list[onegov.core.elements.Link | onegov.core.elements.LinkGroup] [source]
Returns the links associated with the current ticket in the following format:
[ ('Link Title', 'http://link'), ('Link Title 2', 'http://link2'), ]
If the links are not tuples, but callables, they will be called with the request which should return the rendered link.