org.pdf.ticket

Classes

TicketQrCode

TicketBasePdf

TicketPdf

TicketsPdf

Module Contents

class org.pdf.ticket.TicketQrCode[source]

Bases: onegov.qrcode.QrCode

_border = 0[source]
class org.pdf.ticket.TicketBasePdf[source]

Bases: onegov.org.pdf.core.OrgPdf

ticket_summary(html: str | None, linkify: bool = True) → None[source]

A copy of the mini_html adapted for ticket summary. We have to guarantee some backwards compatibility here whenever we change the templates and thereby the snapshot of tickets.

Must work for templates: - directory_entry_submission - display_event - display_form - reservations

ticket_invoice(ticket: onegov.ticket.Ticket, layout: onegov.org.layout.TicketLayout) → None[source]
ticket_payment(ticket: onegov.ticket.Ticket, layout: onegov.org.layout.TicketLayout) → None[source]
class org.pdf.ticket.TicketPdf(*args: Any, **kwargs: Any)[source]

Bases: TicketBasePdf

property page_fn: collections.abc.Callable[[reportlab.pdfgen.canvas.Canvas, onegov.pdf.templates.Template], None][source]

First page the same as later except Qr-Code.

ticket_metadata(ticket: onegov.ticket.Ticket, layout: onegov.org.layout.TicketLayout) → None[source]
ticket_timeline(msg_feed: collections.abc.Mapping[str, Any] | None) → None[source]

Will parse the timeline from view_messages_feed

extract_feed_info(html: str | None) → list[str | None] | None[source]

Must be able to parse templates message_{message.type}.pt and return the useful data in cleaned form.

add_ticket(ticket: onegov.ticket.Ticket, request: onegov.org.request.OrgRequest) → None[source]

Adds a ticket to the story.

classmethod from_ticket(request: onegov.org.request.OrgRequest, ticket: onegov.ticket.Ticket) → io.BytesIO[source]

Creates a PDF representation of the ticket. It is sensible to the templates used to render the message feed and the summary of the ticket coming from ticket handler. With this approach, snapshotted summaries are supported.

class org.pdf.ticket.TicketsPdf(*args: Any, **kwargs: Any)[source]

Bases: TicketPdf

filter_info(form: onegov.org.forms.TicketInvoiceSearchForm, request: onegov.org.request.OrgRequest) → None[source]
classmethod from_tickets(request: onegov.org.request.OrgRequest, tickets: collections.abc.Collection[onegov.ticket.Ticket], form: onegov.org.forms.TicketInvoiceSearchForm | None = None) → io.BytesIO[source]

Creates a PDF representation of the tickets. It is sensible to the templates used to render the message feed and the summary of the ticket coming from ticket handler. With this approach, snapshotted summaries are supported.