Hi again,

I'm trying to include two views in one html template, however the
latter(bolded) view doesn't work.

The first one works well and I can see the items created within last 15
minutes in my webpage. However when I want to see the older items (bolded
html part and index1 in views.py), I don't get anything, not even an error.
Do I need to add something to other files in Django or is this even
possible?

- Mikko

                                <div class="col-lg-8">
<ul>
{% for news in newstest %}
<h4> <a href="{{ news.url }}" >{{ news.title }}</a> </h4>
<p>{{ news.publisher }} {{ news.section }} {{ news.country }}</p>
<hr class="m-y-md" />
{% endfor %}

<p> +15 min </p>

*{% for news in newstest1 %}*
* <h4> <a href="{{ news.url }}" >{{ news.title }}</a> </h4>*
* <p>{{ news.publisher }} {{ news.section }} {{ news.country }}</p>*
* <hr class="m-y-md" />*
* {% endfor %}*
</ul>
</div>



def index(request):
    newstest = NewsData.objects.filter(created__gt= time.time() -
900).order_by('-created')
    args = {'newstest': newstest}
    return render(request, "news/index.html", args)

def index1(request):
    newstest1 = NewsData.objects.filter(created__lt= time.time() -
900).order_by('-created')
    args1 = {'newstest1': newstest1}
    return render(request, "news/index.html", args1)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGD0jjLmhg2SzTb6oCtapBK_h4AN5_zCUdsj7ntHGfteqiRFvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to