thank you
Le dim. 9 août 2020 à 09:12, Liu Zheng a écrit :
> Hi,
>
> Not sure it's a good idea to do database query inside the template.
> Templates are capable of running some logics but for a heavy-lifting job
> like database query, it should be a good practice to do it in the view, and
>
Hi,
Not sure it's a good idea to do database query inside the template.
Templates are capable of running some logics but for a heavy-lifting job
like database query, it should be a good practice to do it in the view, and
only pass the results to the template.
On Sun, Aug 9, 2020 at 4:30 AM Agoua
As Django template engine do not support the parenthèses you Can try to
make a custom filter
Le sam. 8 août 2020 à 20:27, Agoua David a écrit :
> You Can try to use .count instead
>
> Le sam. 8 août 2020 à 17:56, N'BE SORO a écrit :
>
>> Good evening please
>>
>> Can you help me?
>>
>> I want
You Can try to use .count instead
Le sam. 8 août 2020 à 17:56, N'BE SORO a écrit :
> Good evening please
>
> Can you help me?
>
> I want to display the number of items with a filter.
> Example:
> this call returns 4 elements
> {{ item.class.classecours.all|length}}
>
> at the .all level
> make
Good evening please
Can you help me?
I want to display the number of items with a filter.
Example:
this call returns 4 elements
{{ item.class.classecours.all|length}}
at the .all level
make an item.class.classecours.filter(status==True)|length
--
You received this message because you are
5 matches
Mail list logo