add logout logic and wip recap

This commit is contained in:
Julien Aldon
2026-02-18 18:08:30 +01:00
parent aca24ca560
commit acbaadff67
29 changed files with 363 additions and 100 deletions

View File

@@ -3,6 +3,7 @@ import jinja2
import src.models as models
import html
from weasyprint import HTML
import io
def generate_html_contract(
contract: models.Contract,
@@ -57,4 +58,25 @@ def generate_html_contract(
return HTML(
string=output_text,
base_url=template_dir
).write_pdf()
).write_pdf()
from odfdo import Document, Table, Row, Cell
def generate_recap(
contracts: list[models.Contract],
form: models.Form,
):
data = [
["nom", "email"],
]
doc = Document("spreadsheet")
sheet = Table(name="Recap")
sheet.set_values(data)
doc.body.append(sheet)
buffer = io.BytesIO()
doc.save(buffer)
return buffer.getvalue()