> In the template I want to show something like
>
> {%if not  len(objects_tatus ) %} # just to clarify the purpose..I know

....

> 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?

 Hi there,

  there is probably more than one way to do it, but the one that comes
to mind is to write a simple custom filter, see
http://dpaste.com/167380/  (not tested)

  then you could use:

{% if object_status|generic_length > 0 %}  (or the pre-1.2 equivalent
using ifequal).

  See 
http://docs.djangoproject.com/en/1.1/howto/custom-template-tags/#howto-custom-template-tags
if you are not familiar with custom tags.

  Please note that I have tested the code, so use it as a guidance only.

  Cheers

    Jirka

-- 
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