org.pdf.ticket
Classes
Generates QR Codes |
|
A PDF document. |
|
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
- class org.pdf.ticket.TicketPdf(*args: Any, **kwargs: Any)[source]
Bases:
onegov.pdf.Pdf
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.
- property page_fn_later: collections.abc.Callable[[reportlab.pdfgen.canvas.Canvas, onegov.pdf.templates.Template], None][source]
- table(data: collections.abc.Sequence[collections.abc.Sequence[str | reportlab.platypus.Paragraph]], columns: Literal['even'] | collections.abc.Sequence[float | None] | None, style: reportlab.platypus.tables.TableStyle | collections.abc.Iterable[reportlab.platypus.tables._TableCommand] | None = None, ratios: Literal[False] = False, border: bool = True, first_bold: bool = True) None [source]
- table(data: collections.abc.Sequence[collections.abc.Sequence[str | reportlab.platypus.Paragraph]], columns: Literal['even'] | list[float] | None, style: reportlab.platypus.tables.TableStyle | collections.abc.Iterable[reportlab.platypus.tables._TableCommand] | None = None, *, ratios: Literal[True], border: bool = True, first_bold: bool = True) None
- table(data: collections.abc.Sequence[collections.abc.Sequence[str | reportlab.platypus.Paragraph]], columns: Literal['even'] | list[float] | None, style: reportlab.platypus.tables.TableStyle | collections.abc.Iterable[reportlab.platypus.tables._TableCommand] | None, ratios: Literal[True], border: bool = True, first_bold: bool = True) None
- table(data: collections.abc.Sequence[collections.abc.Sequence[str | reportlab.platypus.Paragraph]], columns: Literal['even'] | collections.abc.Sequence[float | None] | None, style: reportlab.platypus.tables.TableStyle | collections.abc.Iterable[reportlab.platypus.tables._TableCommand] | None = None, ratios: bool = False, border: bool = True, first_bold: bool = True) None
Adds a table where every cell is wrapped in a paragraph so that the cells are wrappable.
- 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_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.
- classmethod from_tickets(request: onegov.org.request.OrgRequest, tickets: collections.abc.Collection[onegov.ticket.Ticket]) 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.