ya it worked. thank you!
On Sat, Aug 6, 2011 at 11:07 PM, Thomas Orozco wrote:
> In your context you passed your 'lists' object as 'book'.
>
> So {% if book %} would work, but your current syntax won't.
> Le 6 août 2011 19:32, "shakthi" a écrit :
>
> > The if condition in my html template is not
In your context you passed your 'lists' object as 'book'.
So {% if book %} would work, but your current syntax won't.
Le 6 août 2011 19:32, "shakthi" a écrit :
> The if condition in my html template is not working, only else is
> executing.
>
> view function is
> def test(request):
> lists=Book.o
This is because you're passing it as 'book' in the context.
{% if book %} will evaluate to True.
--
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
The if condition in my html template is not working, only else is
executing.
view function is
def test(request):
lists=Book.objects.all()
return render_to_response('test.html',{'book':lists})
template file:test.html
{% if lists %}
{% for a in lists %}
There are {{book|
4 matches
Mail list logo