AÑADIMOS LOGICA al TPL - Plantilla
This commit is contained in:
		
							parent
							
								
									ee87a0715a
								
							
						
					
					
						commit
						ef3490b8f5
					
				|  | @ -9,3 +9,7 @@ Doc.: https://python-docs-es.readthedocs.io/es/3.10/library/venv.html | |||
| 
 | ||||
| * Python ~ tutorial Jinja templates | ||||
| https://realpython.com/primer-on-jinja-templating/ | ||||
| 
 | ||||
| * Control flow - Jinja tpl 's | ||||
| 
 | ||||
| MUSICA INSTRUMENTAL : Wim Mertens | ||||
|  |  | |||
|  | @ -0,0 +1,9 @@ | |||
| 
 | ||||
| HOLA! Frieda, | ||||
| 
 | ||||
|  Estoy happy to inform you that you did very well on today's Python Challenge. | ||||
|  HAs alcanzado esta puntuacion : 92 de { max_score }} PUNTOS ! | ||||
| 
 | ||||
| see you tomorrow, nos vemos :-) | ||||
| 
 | ||||
| Mr. JokerPy | ||||
|  | @ -0,0 +1,9 @@ | |||
| 
 | ||||
| HOLA! Fritz, | ||||
| 
 | ||||
|  Estoy happy to inform you that you did very well on today's Python Challenge. | ||||
|  HAs alcanzado esta puntuacion : 40 de { max_score }} PUNTOS ! | ||||
| 
 | ||||
| see you tomorrow, nos vemos :-) | ||||
| 
 | ||||
| Mr. JokerPy | ||||
|  | @ -0,0 +1,9 @@ | |||
| 
 | ||||
| HOLA! Gergeley, | ||||
| 
 | ||||
|  Estoy happy to inform you that you did very well on today's Python Challenge. | ||||
|  HAs alcanzado esta puntuacion : 87 de { max_score }} PUNTOS ! | ||||
| 
 | ||||
| see you tomorrow, nos vemos :-) | ||||
| 
 | ||||
| Mr. JokerPy | ||||
|  | @ -0,0 +1,9 @@ | |||
| 
 | ||||
| HOLA! Sandrine, | ||||
| 
 | ||||
|  Estoy happy to inform you that you did very well on today's Python Challenge. | ||||
|  HAs alcanzado esta puntuacion : 100 de { max_score }} PUNTOS ! | ||||
| 
 | ||||
| see you tomorrow, nos vemos :-) | ||||
| 
 | ||||
| Mr. JokerPy | ||||
|  | @ -0,0 +1,9 @@ | |||
| 
 | ||||
| HOLA! Sirius, | ||||
| 
 | ||||
|  Estoy happy to inform you that you did very well on today's Python Challenge. | ||||
|  HAs alcanzado esta puntuacion : 75 de { max_score }} PUNTOS ! | ||||
| 
 | ||||
| see you tomorrow, nos vemos :-) | ||||
| 
 | ||||
| Mr. JokerPy | ||||
|  | @ -1,9 +0,0 @@ | |||
| {# templates/message.txt #} | ||||
| HOLA! {{ name }}, | ||||
| 
 | ||||
|  Estoy happy to inform you that you did very well on today's {{ test_name }}. | ||||
|  HAs alcanzado esta puntuación : {{ score }} de { max_score }} PUNTOS ! | ||||
| 
 | ||||
| see you tomorrow, nos vemos :-) | ||||
| 
 | ||||
| Mr. JokerPy | ||||
|  | @ -0,0 +1,20 @@ | |||
| {# templates/message.txt #} | ||||
| HOLA! {{ name }}, | ||||
| 
 | ||||
| {% if score > 80 %} | ||||
| 
 | ||||
|  ( Acá Informamos tan sólo en caso de una cierta puntuación, por encima de un umbral ) | ||||
| 
 | ||||
|  Estoy happy to inform you that you did very well on today's {{ test_name }}. | ||||
|  HAs alcanzado esta puntuacion : {{ score }} de { max_score }} PUNTOS ! ;-) | ||||
| 
 | ||||
| {% else %} | ||||
| 
 | ||||
|  Vaya! Siento informarte de que tu puntuacuón : {{ score }} es más que mejorable ... {{ test_name }} :-| | ||||
| 
 | ||||
| {% endif %} | ||||
| 
 | ||||
| 
 | ||||
| see you tomorrow, nos vemos :-) | ||||
| 
 | ||||
| Mr. JokerPy | ||||
|  | @ -8,6 +8,8 @@ students = [ | |||
|     {"name": "Sandrine",  "score": 100}, | ||||
|     {"name": "Gergeley", "score": 87}, | ||||
|     {"name": "Frieda", "score": 92}, | ||||
|     {"name": "Fritz", "score": 40}, | ||||
|     {"name": "Sirius", "score": 75}, | ||||
| ] | ||||
| 
 | ||||
| environment = Environment(loader=FileSystemLoader("templates/")) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue