(The process should be like this and not like any other!) There is an Object in the database with fields t1, t2, t3, t4, t5 . Each of them is a digital IntegerField. The default is 0 default=0 . There is a number in the pattern (say х ), which is different depending on t 1, t2, t3, t4, t5 . Namely, when they are all equal to 0, then х=0 , but if one of them takes any other number, then х changes to a number equal to the number of non-zero values :) example:
t1=0, t2=1, t3=0, t4=2, t5=0 =>>> x=2 (т.к. t2, t4 не равные 0). Question: how to describe it in a view and pass it to a template? Option with listing if / else of all options ... well, excuse me ...