K
K
Konstantin Malyarov2018-06-06 08:47:07
Django
Konstantin Malyarov, 2018-06-06 08:47:07

Is it possible to do validation through a model method in Django?

index.html

{% if user.check_access('close_department') %}
 <h1>Доступ в закрыто отделение</h1>
{% endif %}

models.py
def check_access(self, department):
     //Тут обработать входные параметры

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question