cineclub-site/server/myapi/services/com_service.py

18 lines
437 B
Python
Raw Normal View History

2022-04-03 01:20:54 +02:00
from django.template.loader import render_to_string
from myapi.models import Film
2022-04-03 01:20:54 +02:00
prices = {"one_cof": 4, "one_exte": 5, "card_cof": 30, "card_exte": 35}
2022-04-03 01:20:54 +02:00
def render_com(template_name, film: Film) -> str:
return render_to_string(template_name, {"film": film, "prices": prices})
def bocal(film: Film) -> str:
2022-04-03 01:20:54 +02:00
return render_com("bocal.tex", film)
def facebook(film: Film) -> str:
return render_com("facebook.txt", film)