org.pdf.ticket

Classes

TicketQrCode

Generates QR Codes

TicketBasePdf

A PDF document.

TicketPdf

A PDF document.

TicketsPdf

A PDF document.

Module Contents

class org.pdf.ticket.TicketQrCode(payload: str | bytes, border: int | None = None, box_size: int | None = None, fill_color: str | None = None, back_color: str | None = None, img_format: str | None = None, encoding: Literal['base64'] | None = None)[source]

Bases: onegov.qrcode.QrCode

Generates QR Codes

_border = 0[source]
class org.pdf.ticket.TicketBasePdf(*args: Any, **kwargs: Any)[source]

Bases: onegov.org.pdf.core.OrgPdf

A PDF document.

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

A PDF document.

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

static extract_feed_info(html: str) 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

A PDF document.

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.