V
V
vdm_mar2018-12-05 20:19:50
Django
vdm_mar, 2018-12-05 20:19:50

How to combine output on html of two querysets?

Good afternoon!
There is a queryset: News1, News2, News3, News4, News5.
There are: Post1, Post2.
News and Post have different fields. Can't merge into one queryset.
You need to make a feed:
News1
News2
Post1
News3
News4
Post2
News5.
The sequence is constant.
Tried via forloop.counter but post.1 works and post.forloop.counter doesn't work.
Can someone tell me if it is possible to do this alternation using template tags and filters or not?
Thank you!

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