#25236: Remove ifequal from the template language
-------------------------------------+-------------------------------------
     Reporter:  Daniel Greenfeld     |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Template system      |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Someday/Maybe
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Jon Dufresne):

 The following quick and dirty script will update a codebase to the newer
 `{% if %}` syntax. This will update files in place, so please be sure to
 backup your code first, preferably with SCM. You should examine the
 results of the diff for correctness before accepting.

 {{{
 find $(find -name templates) -type f -exec perl -pi -e 's/{% *ifequal
 +(.+?) +(.+?) *%}/{% if $1 == $2 %}/;' -e 's/{% *endifequal *%}/{% endif
 %}/;' -e 's/{% *ifnotequal +(.+?) +(.+?) *%}/{% if $1 != $2 %}/;' -e 's/{%
 *endifnotequal *%}/{% endif %}/;' {} \;
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.5910434eae207642a166bd795760e868%40djangoproject.com.

Reply via email to