Медицина/Документы Jinja: различия между версиями
Admin (обсуждение | вклад) |
Нет описания правки |
||
| Строка 11: | Строка 11: | ||
<p>{{ service.name }}</p> | <p>{{ service.name }}</p> | ||
{% endfor %} | {% endfor %} | ||
</syntaxhighlight> | |||
== Шаблоны (jinja2) == | |||
"Документация":http://jinja.pocoo.org/docs/2.10/templates/ | |||
=== Pymorphy2 === | |||
https://pymorphy2.readthedocs.io/en/latest/user/grammemes.html | |||
<syntaxhighlight lang="html"> | |||
{{ "Хомяк ест"|inflect("datv", "plur") }} | |||
{{ "Хомяк"|agree_with_number(4) }} | |||
</syntaxhighlight> | |||
=== Petrovich === | |||
<syntaxhighlight lang="html"> | |||
{{ "Иванов Иван Иванович"|inflectfio(case, gender) }} | |||
post= [0...4] | |||
gender = [0...1] | |||
# Родительный | |||
GENITIVE = 0 | |||
# Дательный | |||
DATIVE = 1 | |||
# Винительный | |||
ACCUSATIVE = 2 | |||
# Творительный | |||
INSTRUMENTAL = 3 | |||
# Предложный | |||
PREPOSITIONAL = 4 | |||
</syntaxhighlight> | |||
=== Barcode === | |||
<syntaxhighlight lang="html"> | |||
{{ barcode128('PATIENT', patient.id) }} | |||
{{ barcode128('PATIENT', patient.id, separator='~', width='300px', height='200px') }} | |||
</syntaxhighlight> | |||
=== Qrcode === | |||
<syntaxhighlight lang="html"> | |||
{{ qrcode('PATIENT', patient.id) }} | |||
{{ qrcode('PATIENT', patient.id, separator='~', size='50px') }} | |||
</syntaxhighlight> | |||
=== Даты === | |||
<syntaxhighlight lang="html"> | |||
{{ now() }} | |||
{{ now('%d.%m.%Y %H:%M') }} | |||
{{ today() }} | |||
{{ today('%d.%m.%Y') }} | |||
</syntaxhighlight> | |||
=== Функции === | |||
<syntaxhighlight lang="html"> | |||
{{ render_layout('name') }} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Версия от 23:54, 1 мая 2023
Некешируемое изображение
<img src="{{ src }}?{{ timestamp() }}" />
Медицинский осмотр
{{ record.case }}
{% for service in record.case.get_services(include_complex_service=True) %}
<p>{{ service.name }}</p>
{% endfor %}
Шаблоны (jinja2)
"Документация":http://jinja.pocoo.org/docs/2.10/templates/
Pymorphy2
https://pymorphy2.readthedocs.io/en/latest/user/grammemes.html
{{ "Хомяк ест"|inflect("datv", "plur") }}
{{ "Хомяк"|agree_with_number(4) }}
Petrovich
{{ "Иванов Иван Иванович"|inflectfio(case, gender) }}
post= [0...4]
gender = [0...1]
# Родительный
GENITIVE = 0
# Дательный
DATIVE = 1
# Винительный
ACCUSATIVE = 2
# Творительный
INSTRUMENTAL = 3
# Предложный
PREPOSITIONAL = 4
Barcode
{{ barcode128('PATIENT', patient.id) }}
{{ barcode128('PATIENT', patient.id, separator='~', width='300px', height='200px') }}
Qrcode
{{ qrcode('PATIENT', patient.id) }}
{{ qrcode('PATIENT', patient.id, separator='~', size='50px') }}
Даты
{{ now() }}
{{ now('%d.%m.%Y %H:%M') }}
{{ today() }}
{{ today('%d.%m.%Y') }}
Функции
{{ render_layout('name') }}