V
V
Vitaly Ananiev2022-01-09 15:29:48
Django
Vitaly Ananiev, 2022-01-09 15:29:48

How not to display information from the model field in the database if it is not filled?

How not to display information from the model field in the database if it is not filled?
example:

{% if games.game_currency.blank %}
    <p></p>
{% else %}
    <p><a href="{{ games.currency_absolute_url }}">{{ games.game_currency }}</a></p>
{% endif %}
<p><a href="{{ games.accounts_absolute_url }}">{{ games.game_account }}</a></p>
<p><a href="{{ games.items_absolute_url }}">{{ games.game_items }}</a></p>
<p><a href="{{ games.services_absolute_url }}">{{ games.game_services }}</a></p>
<br>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2022-01-09
@Vitalii181190

1. Where did blank come from?
2. let's start reading the documentation thoughtfully

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question