Opened 15 years ago

Closed 15 years ago

#13775 closed (wontfix)

Clarify in docs that filters don't work in ifequal

Reported by: jogwen Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords: ifequal filter
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Can you please make it a bit more explicit in http://docs.djangoproject.com/en/1.0/ref/templates/builtins/#ifequal that ifequal cannot evaluate its arguments - I just wasted several hours (and created several custom filters) trying to work out why

ifequal request.GET.ds_doc_type type.id|toUnicode

always evaluates to False when

{{request.GET.ds_doc_type}}({{request.GET.ds_doc_type|getType}})
and
{{type.id|toUnicode}}({{type.id|toUnicode|getType}})

looked identical when rendered to the screen.

I've now written a custom filter to do the equality check and am using it in an 'if' which seems to work ok.

Many Thanks,

Jo

Change History (1)

comment:1 by Luke Plant, 15 years ago

Resolution: wontfix
Status: newclosed

The 1.0 branch is no longer receiving bugfixes (and that includes documentation). Why not use Django 1.2? Then you can do:

{% if request.GET.ds_doc_type == type.id|toUnicode %}

which will do what you want.

Note: See TracTickets for help on using tickets.
Back to Top