Код: Выделить всё
{% extends "bank_accounts.html" %}
{% block title %} Statement {% endblock %}
function change_order(o, o2) {
document.getElementById(o).selected=True;
document.getElementById(o2).selected=True;
}
{% block main %}
{{ order }} {{ order2 }}
STATEMENT
Below you can see statement from current month for your account({{ acc }}):
{% csrf_token %}Sort by:
Date
From
To
Type
Sum
Ascending
Descending
Date and time
From
To
Type
Sum
Reference
Saldo after transaction
{% for x in history %}
{% if x.type == "IN" %}
{{ x.date|date:"d/m/Y" }} {{ x.date|time:"h:i:s A" }}
{{ x.sender }}
{{ x.recipient }}
{{ x.t`your text`ype }}
{{ x.amount }}
{{ x.trans_ref }}
{{ x.after_saldo }}
{% else %}
{{ x.date|date:"d/m/Y" }} {{ x.date|time:"h:i:s A" }}
{{ x.sender }}
{{ x.recipient }}
{{ x.type }}
{{ x.amount }}
{{ x.trans_ref }}
{{ x.after_saldo }}
{% endif %}
{% endfor %}
[h4]Below you can specify dates for your statement[/h4]
Apply
{% endblock %}
< /code>
Я не добавляю свой код Views.py, когда проверял, передаются ли переменные контекста, добавив тег P и отображая их оба в этой части: < /p>
{% block main %}
{{ order }} {{ order2 }}
STATEMENT
1.first One был таким же, как и выше, но без изменения выбранного на True , но просто оставив его по адресу. Selected , чтобы добавить этот атрибут к правильному
2.in второй, я пытался изменить. />
Код: Выделить всё
{% csrf_token %}Sort by:
Date
From
To
Type
Sum
Ascending
Descending
Код: Выделить всё
[h4]Below you can specify dates for your statement[/h4]
Я попробовал решение от C3roe, и оно работало с небольшим изменением:
вместо. Selected = true Я сделал .selected = 'true' .
Я пробовал эту опцию раньше, но я не использовал отдельные кавычки (') для .selected =' true '. Тем не менее, решение C3roe сработало и спасибо за это.
Подробнее здесь: https://stackoverflow.com/questions/797 ... rom-django
Мобильная версия