Thank you so much, for this reply that solves my problem :)
Le lundi 18 février 2019 16:15:05 UTC+1, abdouramane mahamane a écrit :
>
> I'm trying to show in one template .html multiple results of my views.py
> class.
> But when i add an other {%block content2 %} in my base.html, i have an
> er
Thank you so much, for this reply that solves my problem :)
Le lundi 18 février 2019 22:55:24 UTC+1, mohamed khaled a écrit :
>
> I think this link can help you
>
> https://www.google.com/url?sa=t&source=web&rct=j&url=https://stackoverflow.com/questions/12187751/django-pass-multiple-models-to-one
I had this proble too. Heres how i solved it.
First i had a model method:
def get_wordcount(self):
return len(self.content.split())
(content is a TextField)
Then in my template i used it like this:
{{ object.content|truncatewords:60 }}
{% load base_utils %}
{% ifg
That definitely looks feasible - thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send
On 10/29/06, ringemup <[EMAIL PROTECTED]> wrote:
>
> Does that mean that this is really view logic? It seems a shame to
> have to write a custom view function just to do something that's as
> simple and as display-related as that. Is there any way to do this in
> the template?
You could split t
5 matches
Mail list logo