Big refactoring.
- clubs, booking platforms and user are now defined in customization files -> there are less environment variables - the responsibility of the session moved - booking cancellation is available
This commit is contained in:
parent
dbda5a158e
commit
0938fb98b7
27 changed files with 3050 additions and 696 deletions
12
resa_padel/payload_builders.py
Normal file
12
resa_padel/payload_builders.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
from pathlib import Path
|
||||
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
|
||||
class PayloadBuilder:
|
||||
@staticmethod
|
||||
def build(template_path: Path, **kwargs) -> str:
|
||||
environment = Environment(loader=FileSystemLoader(template_path.parent))
|
||||
template = environment.get_template(template_path.name)
|
||||
|
||||
return template.render(**kwargs)
|
Loading…
Add table
Add a link
Reference in a new issue