feat [api]: first shot ics route
This commit is contained in:
parent
5721930803
commit
4ab121bea8
3 changed files with 23 additions and 0 deletions
|
@ -26,3 +26,7 @@ def facebook_title(film: Film) -> str:
|
||||||
|
|
||||||
def mail(film: Film) -> str:
|
def mail(film: Film) -> str:
|
||||||
return render_com("mail.html", film)
|
return render_com("mail.html", film)
|
||||||
|
|
||||||
|
|
||||||
|
def ics(film: Film) -> str:
|
||||||
|
return render_com("ics.md", film)
|
||||||
|
|
15
server/myapi/templates/ics.md
Normal file
15
server/myapi/templates/ics.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{% load film_tags %}
|
||||||
|
|
||||||
|
{{ film.title }} - {{ film.director }}
|
||||||
|
|
||||||
|
**Pays** : {{ film.origin_country }}
|
||||||
|
**Durée** : {{ film.duration|movie_duration }}
|
||||||
|
**Année** : {{ film.release_year }}
|
||||||
|
{% color_display film.is_in_color %}
|
||||||
|
{{ film.movie_format }} . {{ film.language_subtitles }}
|
||||||
|
**Avec** : {% list_actors film.actors %}
|
||||||
|
|
||||||
|
Plus d'informations sur [notre site Internet](http://www.cineclub.ens.fr/category/seances/), [facebook](https://www.facebook.com/cineclub.ensulm), [instagram](https://www.instagram.com/cineclubens/) ou via la [newsletter](https://lists.ens.psl.eu/wws/info/cineclub-informations)
|
||||||
|
|
||||||
|
Comme d’habitude, l’entrée coûte {{ prices.one_cof }}€ pour les membres du COF.
|
||||||
|
L’entrée est gratuite pour les membres du Programme Étudiant⋅e⋅s Invité⋅e⋅s.
|
|
@ -38,3 +38,7 @@ class FilmViewSet(viewsets.ModelViewSet):
|
||||||
@action(detail=True, renderer_classes=[StaticHTMLRenderer], methods=["GET"])
|
@action(detail=True, renderer_classes=[StaticHTMLRenderer], methods=["GET"])
|
||||||
def newsletter(self, request, pk=None):
|
def newsletter(self, request, pk=None):
|
||||||
return self.general_com_view(com.mail)
|
return self.general_com_view(com.mail)
|
||||||
|
|
||||||
|
@action(detail=True, methods=["GET"], renderer_classes=[PlainTextRenderer])
|
||||||
|
def ics(self, request, pk=None):
|
||||||
|
return self.general_com_view(com.ics)
|
||||||
|
|
Loading…
Reference in a new issue