2010/3/3 harryos <oswald.ha...@gmail.com>

>
> hi
> I am passing a dictionary to the template
> say,
> objects_status={obj1:True,   obj2:False,  obj3:True }
>
> In the template I want to show something like
>
> {%if not  len(objects_tatus ) %} # just to clarify the purpose..I know
> len will not work
> No objects to show
>
> {% else %}
> Objects are:
> .....
>
> {%endif %}
>
>
> But how can I check the size of the dictionary? If it was a Queryset I
> could have used qset.count  ..but here it would not work.
> Can somebody help?
>
> thanks
> harry
>
>

I would try with

 {%if not  object_status.0 %}



-- 
Alessandro Pasotti
w3:   www.itopen.it

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to