PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  ]c@sdZddlmZddlZddlZddlZddlmZddlmZddl m Z m Z ddl mZddlmZmZdd lmZdd lmZmZdd lmZmZdd lmZd dlmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.d dl/m0Z0d dl1m2Z2d dl3m4Z4m5Z5e2Z6de(fdYZ7de(fdYZ8de(fdYZ9de(fdYZ:de(fdYZ;de(fdYZ<de(fdYZ=d e(fd!YZ>d"e(fd#YZ?d$e(fd%YZ@d&e(fd'YZAd(e(fd)YZBed*d+d,gZCd-e(fd.YZDd/e(fd0YZEd1e(fd2YZFd3e(fd4YZGd5e(fd6YZHd7e(fd8YZId9e(fd:YZJd;e(fd<YZKd=e(fd>YZLd?e(fd@YZMe6jNdAZOe6jNdBZPe6jNdCZ e6jNdDZQe6jNdEZRe6jNdFdGZSe6jNdHZTe6jNdIdJZUdKZVe6jNdLZWe6jNdMZXdNe5fdOYZYdPe4fdQYZZe6jNdRdSZ[e6jNdTZ\dUZ]dVZ^e6jNdWZ_e6jNdXZ`e6jNdYZae6jNdZZbe6jNd[Zce6jNd\Zde6jNd]Zee6jNd^Zfe6jNd_Zge6jNd`Zhe6jNdadbZidS(cuEDefault tags used by the template system, available to all templates.i(tunicode_literalsN(t namedtuple(tdatetime(tcycletgroupby(tsettings(tsixttimezone(t force_text(tconditional_escapet format_html(t paragraphstwords(t mark_safei(t BLOCK_TAG_ENDtBLOCK_TAG_STARTtCOMMENT_TAG_ENDtCOMMENT_TAG_STARTtFILTER_SEPARATORtSINGLE_BRACE_ENDtSINGLE_BRACE_STARTtVARIABLE_ATTRIBUTE_SEPARATORtVARIABLE_TAG_ENDtVARIABLE_TAG_STARTtContexttNodetNodeListtTemplateSyntaxErrortVariableDoesNotExisttkwarg_retrender_value_in_contextt token_kwargs(tdate(tLibrary(tIfParsertLiteraltAutoEscapeControlNodecBs eZdZdZdZRS(u-Implements the actions of the autoescape tag.cCs|||_|_dS(N(tsettingtnodelist(tselfR%R&((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt__init__"scCsK|j}|j|_|jj|}||_|jrCt|S|SdS(N(t autoescapeR%R&trenderR (R'tcontextt old_settingtoutput((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR*%s     (t__name__t __module__t__doc__R(R*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR$ s t CommentNodecBseZdZRS(cCsdS(Nu((R'R+((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR*1s(R.R/R*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR10st CsrfTokenNodecBseZdZRS(cCs\|jd}|r;|dkr+tdStd|SntjrTtjdndSdS(Nu csrf_tokenu NOTPROVIDEDuu=uA {% csrf_token %} was used in a template, but the context did not provide the value. This is usually caused by not using RequestContext.(tgetR RtDEBUGtwarningstwarn(R'R+t csrf_token((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR*6s    (R.R/R*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR25st CycleNodecBs)eZdedZdZdZRS(cCs||_||_||_dS(N(t cyclevarst variable_nametsilent(R'R9R:R;((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR(Js  cCs||jkr(t|j|j|u, (R[RLRYRZtlenR\(R't reversed_text((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt__repr__s!ccs6x|jD] }|Vq Wx|jD] }|Vq#WdS(N(R\R](R'tnode((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt__iter__s c Cs}d|kr|d}ni}|j3y|jj|t}Wntk r^g}nX|dkrtg}nt|dst|}nt|}|dkr|j j |Sg}|j rt |}nt|j }|dk}i|d6}|ds(RQRZR?RVRRDthasattrtlistR^R]R*R[treversedRYt enumerateREt TypeErrort ValueErrortformattdicttziptupdateR\RItrender_annotatedtpopR RL(R'R+t parentlooptvaluest len_valuesR&t num_loopvarstunpackt loop_dicttititemt pop_contexttlen_itemt unpacked_varsRa((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR*s^               (u nodelist_loopunodelist_emptyN(R.R/tchild_nodelistsRDR(R`RbR*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyRXs   t IfChangedNodecBs)eZdZdZdZdZRS(u nodelist_trueunodelist_falsecGs |||_|_||_dS(N(t nodelist_truetnodelist_falset_varlist(R'R~Rtvarlist((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR(scCs|j|}||kr(d||((R'((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR`scCsu|jj|t}|jj|t}|jr?||ksU|j re||kre|jj|S|jj|S(N(RR?RVRRR~R*R(R'R+tval1tval2((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR*s +(u nodelist_trueunodelist_false(R.R/R|R(R`R*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyRs  tIfNodecBs;eZdZdZdZedZdZRS(cCs ||_dS(N(tconditions_nodelists(R'R((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR('scCsdS(Nu((R'((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR`*sccs4x-|jD]"\}}x|D] }|VqWq WdS(N(R(R't_R&Ra((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyRb-s cCstd|jDS(Ncss(|]\}}|D] }|VqqdS(N((RcRR&Ra((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pys 4s(RR(R'((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR&2scCssxl|jD]a\}}|dk rRy|j|}WqXtk rNd}qXXnt}|r |j|Sq WdS(Nu(RRDtevalRRVR*(R'R+t conditionR&tmatch((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR*6s   (R.R/R(R`RbtpropertyR&R*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR%s    t LoremNodecBseZdZdZRS(cCs!||||_|_|_dS(N(tcounttmethodtcommon(R'RRR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR(HscCsyt|jj|}Wnttfk r;d}nX|jdkr^t|d|jSt|d|j}|jdkrg|D]}d|^q}ndj |S(NiuwRupu

%s

u ( tintRR?RjRiRR RR RL(R'R+Rtparastp((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR*Ks  (R.R/R(R*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyRGs u GroupedResultugrouperulistt RegroupNodecBs#eZdZdZdZRS(cCs |||_|_||_dS(N(ttargett expressiontvar_name(R'RRR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR(]scCs |||j<|jj|tS(N(RRR?RV(R'tobjR+((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pytresolve_expressionas csjjt}|dkr2gjrstgrouperRf(RR?RVRDRRt GroupedResultRf(R'R+tobj_listtkeyRM((R+R's?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR*gs  M(R.R/R(RR*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR\s  tLoadNodecBseZdZRS(cCsdS(Nu((R'R+((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR*xs(R.R/R*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyRwstNowNodecBseZddZdZRS(cCs||_||_dS(N(t format_stringRT(R'RRT((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR(}s cCs[tjrtjnd}ttjd||j}|j rS|||j t k ryjj j }Wqt k rd}qXnXd} y"||d|d|d|} Wn&|k r |jdkrqnX|jr(| |js uRRt current_app(t django.urlsRRRR?RtitemsRtrequestRtAttributeErrortresolver_matcht namespaceRDRTR)R ( R'R+RRtargRRRRturl((R+s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR*s0%   "     (R.R/R(R*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyRs t VerbatimNodecBseZdZdZRS(cCs ||_dS(N(tcontent(R'R((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR(scCs|jS(N(R(R'R+((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR*s(R.R/R(R*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyRs tWidthRatioNodecBseZddZdZRS(cCs(||_||_||_||_dS(N(tval_exprtmax_exprt max_widthRT(R'RRRRT((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR(s   cCs y@|jj|}|jj|}t|jj|}Wn4tk rTdSttfk rvtdnXyBt |}t |}|||}t tt |}Wn,t k rdSttt fk rdSX|jr|||j((R'((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR` scsLfdtj|jD}j||jjSWdQXdS(Ncs(i|]\}}|j|qS((R?(RcRRM(R+(s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pys s (Rt iteritemsRRQR&R*(R'R+Rr((R+s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR* s N(R.R/RDR(R`R*(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyRs  cCs|jj}t|dkr0tdn|d}|dkrUtdn|jd }|jt|dk|S( u3 Force autoescape behavior for this block. iu/'autoescape' tag requires exactly one argument.iuonuoffu-'autoescape' argument should be 'on' or 'off'u endautoescape(uonuoff(u endautoescape(tcontentstsplitR^Rtparsetdelete_first_tokenR$(tparserttokenRRR&((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR)s   cCs|jdtS(uP Ignores everything between ``{% comment %}`` and ``{% endcomment %}``. u endcomment(t skip_pastR1(RR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pytcomment%s c Cs|j}t|dkr-tdnt|dkr|d}t|dsktd|n||jkrtd|n|j|St}t|dkr"|dd kr|d d krtd |d nt}t}|d }q"|d d kr"t}t}q"n|r|d }g|dd !D]}|j|^q@}t||d|}t|dsi|_n||j| ... {% endfor %} Outside of a loop, give the values a unique name the first time you call it, then use that name each successive time through:: ... ... ... You can use any number of values, separated by spaces. Commas can also be used to separate values; if a comma is used, the cycle values are interpreted as literal strings. The optional flag "silent" can be used to prevent the cycle declaration from returning any value:: {% for o in some_list %} {% cycle 'row1' 'row2' as rowcolors silent %} {% include "subtemplate.html " %} {% endfor %} iu+'cycle' tag requires at least two argumentsiu_named_cycle_nodesu0No named cycles in template. '%s' is not defineduNamed cycle '%s' does not existiiuasiusilentu;Only 'silent' flag is allowed after cycle's name, not '%s'.iR;( tsplit_contentsR^RRet_named_cycle_nodesRERVtcompile_filterR8t_last_cycle_node( RRRRtas_formR;RRrRa((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR.s@.      ) &  cCstS(N(R2(RR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR7scCstS(u Outputs a whole load of debugging information, including the current context and imported modules. Sample usage::
            {% debug %}
        
(RF(RR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pytdebugs ufilterc Cs|jjdd\}}|jd|}xH|jD]=\}}t|dd}|d kr8td|q8q8W|jd }|jt ||S( u  Filters the contents of the block through variable filters. Filters can also be piped through each other, and they can have arguments -- just like in variable syntax. Sample usage:: {% filter force_escape|lower %} This text will be HTML-escaped, and will appear in lowercase. {% endfilter %} Note that the ``escape`` and ``safe`` filters are not acceptable arguments. Instead, use the ``autoescape`` tag to manage autoescaping for blocks of template code. iuvar|%su _filter_nameuescapeusafeu@"filter %s" is not permitted. Use the "autoescape" tag instead.u endfilterN(uescapeusafe(u endfilter( RRRDRtfilterstgetattrRRRRN( RRRtrestROtfunctunusedt filter_nameR&((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt do_filters  cCs|jd}d}t|dkr7tdnt|dkrp|ddkrp|d}|d }ntg|D]}|j|^qz|S(u Outputs the first variable passed that is not False. Outputs nothing if all the passed variables are False. Sample usage:: {% firstof var1 var2 var3 as myvar %} This is equivalent to:: {% if var1 %} {{ var1 }} {% elif var2 %} {{ var2 }} {% elif var3 %} {{ var3 }} {% endif %} but obviously much cleaner! You can also use a literal string as a fallback value in case all passed variables are False:: {% firstof var1 var2 var3 "fallback value" %} If you want to disable auto-escaping of variables you can use:: {% autoescape off %} {% firstof var1 var2 var3 "fallback value" %} {% autoescape %} Or if only some variables should be escaped, you can use:: {% firstof var1 var2|safe var3 "fallback value"|safe %} iu2'firstof' statement requires at least one argumentiiuasiN(RRDR^RRRR(RRtbitsRTtbit((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pytfirstofs&"  uforc Csm|j}t|dkr4td|jn|ddk}|rPdnd}||dkr|td|jntd d d tf}tjd d j|d |!}x;|D]3}| s|j | rtd|jqqW|j ||d }|j d} |j }|jdkrQ|j d} |j nd} t|||| | S(u' Loops over each item in an array. For example, to display a list of athletes given ``athlete_list``::
    {% for athlete in athlete_list %}
  • {{ athlete.name }}
  • {% endfor %}
You can loop over a list in reverse by using ``{% for obj in list reversed %}``. You can also unpack multiple values from a two-dimensional array:: {% for key,value in dict.items %} {{ key }}: {{ value }} {% endfor %} The ``for`` tag can take an optional ``{% empty %}`` clause that will be displayed if the given array is empty or could not be found::
    {% for athlete in athlete_list %}
  • {{ athlete.name }}
  • {% empty %}
  • Sorry, no athletes in this list.
  • {% endfor %}
      The above is equivalent to -- but shorter, cleaner, and possibly faster than -- the following::
        {% if athlete_list %} {% for athlete in athlete_list %}
      • {{ athlete.name }}
      • {% endfor %} {% else %}
      • Sorry, no athletes in this list.
      • {% endif %}
      The for loop sets a number of variables available within the loop: ========================== ================================================ Variable Description ========================== ================================================ ``forloop.counter`` The current iteration of the loop (1-indexed) ``forloop.counter0`` The current iteration of the loop (0-indexed) ``forloop.revcounter`` The number of iterations from the end of the loop (1-indexed) ``forloop.revcounter0`` The number of iterations from the end of the loop (0-indexed) ``forloop.first`` True if this is the first time through the loop ``forloop.last`` True if this is the last time through the loop ``forloop.parentloop`` For nested loops, this is the loop "above" the current one ========================== ================================================ iu4'for' statements should have at least four words: %siureversediiuinu7'for' statements should use the format 'for x in y': %su u"u'u *, *iu*'for' tag received an invalid argument: %suemptyuendfor(uemptyuendfor(uendforN(RR^RRt frozensetRtreRRLt isdisjointRRt next_tokenRRDRX( RRRR[tin_indext invalid_charsRYRPRZR\R]((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pytdo_fors.? "   c Cst|j}t|dkr;td|dnd|d}|jd|f}|j}|jdkr|j|f}|jn t}|j |d}|j |d}t |||||S(Niu%r takes two argumentsiuenduelseii( RfRR^RRRRRRRR( RRRRtend_tagR~RRR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt do_ifequalEs   cCst||tS(u; Outputs the contents of the block if the two arguments equal each other. Examples:: {% ifequal user.id comment.user_id %} ... {% endifequal %} {% ifnotequal user.id comment.user_id %} ... {% else %} ... {% endifnotequal %} (RRE(RR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pytifequalVscCst||tS(u` Outputs the contents of the block if the two arguments are not equal. See ifequal. (RRV(RR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt ifnotequaljstTemplateLiteralcBs#eZdZdZdZRS(cCs||_||_dS(N(RBttext(R'RBR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR(ts cCs|jS(N(R(R'((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pytdisplayxscCs|jj|dtS(Ntignore_failures(RBR?RV(R'R+((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR{s(R.R/R(RR(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyRss  tTemplateIfParsercBs eZeZdZdZRS(cOs&||_tt|j||dS(N(ttemplate_parsertsuperRR((R'RRR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR(s cCst|jj||S(N(RRR(R'RB((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt create_vars(R.R/Rt error_classR(R(((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyRs uifcCs5|jd}t||j}|jd}||fg}|j}xi|jjdr|jd}t||j}|jd}|j||f|j}qRW|jdkr|jd}|jd |f|j}n|jdkr+tdj |j |jnt |S( u The ``{% if %}`` tag evaluates a variable, and if that variable is "true" (i.e., exists, is not empty, and is not a false boolean value), the contents of the block are output: :: {% if athlete_list %} Number of athletes: {{ athlete_list|count }} {% elif athlete_in_locker_room_list %} Athletes should be out of the locker room soon! {% else %} No athletes. {% endif %} In the above, if ``athlete_list`` is not empty, the number of athletes will be displayed by the ``{{ athlete_list|count }}`` variable. As you can see, the ``if`` tag may take one or several `` {% elif %}`` clauses, as well as an ``{% else %}`` clause that will be displayed if all previous conditions fail. These clauses are optional. ``if`` tags may use ``or``, ``and`` or ``not`` to test a number of variables or to negate a given variable:: {% if not athlete_list %} There are no athletes. {% endif %} {% if athlete_list or coach_list %} There are some athletes or some coaches. {% endif %} {% if athlete_list and coach_list %} Both athletes and coaches are available. {% endif %} {% if not athlete_list or coach_list %} There are no athletes, or there are some coaches. {% endif %} {% if athlete_list and not coach_list %} There are some athletes and absolutely no coaches. {% endif %} Comparison operators are also available, and the use of filters is also allowed, for example:: {% if articles|length >= 5 %}...{% endif %} Arguments and operators _must_ have a space between them, so ``{% if 1>2 %}`` is not a valid if tag. All supported operators are: ``or``, ``and``, ``in``, ``not in`` ``==``, ``!=``, ``>``, ``>=``, ``<`` and ``<=``. Operator precedence follows Python. iuelifuelseuendifu)Malformed template tag at line {0}: "{1}"(uelifuelseuendif(uelifuelseuendif(uendifN( RRRRRt startswithRIRDRRktlinenoR(RRRRR&R((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pytdo_ifs$= !cCs|j}|jd}|j}|jdkrR|jd}|jn t}g|dD]}|j|^qf}t|||S(um Checks if a value has changed from the last iteration of a loop. The ``{% ifchanged %}`` block tag is used within a loop. It has two possible uses. 1. Checks its own rendered contents against its previous state and only displays the content if it has changed. For example, this displays a list of days, only displaying the month if it changes::

      Archive for {{ year }}

      {% for date in days %} {% ifchanged %}

      {{ date|date:"F" }}

      {% endifchanged %} {{ date|date:"j" }} {% endfor %} 2. If given one or more variables, check whether any variable has changed. For example, the following shows the date every time it changes, while showing the hour if either the hour or the date has changed:: {% for date in days %} {% ifchanged date.date %} {{ date.date }} {% endifchanged %} {% ifchanged date.hour date.date %} {{ date.hour }} {% endifchanged %} {% endfor %} uelseu endifchangedi(uelseu endifchanged(u endifchanged(RRRRRRRR}(RRRR~RRRr((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt ifchangeds    &cCsUy|j|SWn?tk rPtd|djt|jjfnXdS(Nu8'%s' is not a registered tag library. Must be one of: %su (t librariestKeyErrorRRLtsortedtkeys(RR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt find_library s  cCst}x|D]}t}||jkrHt}|j||j|`` tags * ``{% lorem 2 w random %}`` will output two random latin words iiurandomuwupubiu1uIncorrect format for %r tag(uwupub(RfRRpR^RRR(RRRttagnameRRR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pytloremLs  cCs|j}d}t|dkrK|ddkrK|d}|d }nt|dkrltdn|ddd!}t||S( u Displays the date, formatted according to the given string. Uses the same format as PHP's ``date()`` function; see http://php.net/date for all the possible values. Sample usage:: It is {% now "jS F Y H:i" %} iiuasiiu"'now' statement takes one argumentiN(RRDR^RR(RRRRTR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyR{s "  cCs|j}t|dkr-tdn|j|d}|ddkr_tdn|ddkr~td n|d }|j|t|d }t|||S( uw Regroups a list of alike objects by a common attribute. This complex tag is best illustrated by use of an example: say that ``musicians`` is a list of ``Musician`` objects that have ``name`` and ``instrument`` attributes, and you'd like to display a list that looks like: * Guitar: * Django Reinhardt * Emily Remler * Piano: * Lovie Austin * Bud Powell * Trumpet: * Duke Ellington The following snippet of template code would accomplish this dubious task:: {% regroup musicians by instrument as grouped %}
        {% for group in grouped %}
      • {{ group.grouper }}
          {% for musician in group.list %}
        • {{ musician.name }}
        • {% endfor %}
        {% endfor %}
      As you can see, ``{% regroup %}`` populates a variable with a list of objects with ``grouper`` and ``list`` attributes. ``grouper`` contains the item that was grouped by; ``list`` contains the list of objects that share that ``grouper``. In this case, ``grouper`` would be ``Guitar``, ``Piano`` and ``Trumpet``, and ``list`` is the list of musicians who play this instrument. Note that ``{% regroup %}`` does not work when the list to be grouped is not sorted by the key you are grouping by! This means that if your list of musicians was not sorted by instrument, you'd need to make sure it is sorted before using it, i.e.:: {% regroup musicians|dictsort:"instrument" by instrument as grouped %} iu"'regroup' tag takes five argumentsiiubyu-second argument to 'regroup' tag must be 'by'iuasu3next-to-last argument to 'regroup' tag must be 'as'ii(RR^RRRR(RRRRRR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pytregroups/  cCs|j}t|dkr5td|dnt|dkr|d}yt|j|SWqttfk rtd|qXnyt|jSWntk rtdnXdS(u Resets a cycle tag. If an argument is given, resets the last rendered cycle tag whose name matches the argument, else resets the last rendered cycle tag (named or unnamed). iu$%r tag accepts at most one argument.iiu Named cycle '%s' does not exist.uNo cycles in template.N(RR^RRRRR R(RRRR((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt resetcycles   cCs#|jd}|jt|S(uB Removes whitespace between HTML tags, including tab and newline characters. Example usage:: {% spaceless %}

      Foo

      {% endspaceless %} This example would return this HTML::

      Foo

      Only space between *tags* is normalized -- not space between tags and text. In this example, the space around ``Hello`` won't be stripped:: {% spaceless %} Hello {% endspaceless %} u endspaceless(u endspaceless(RRR(RRR&((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt spacelesss cCsu|jj}t|dkr0tdn|d}|tjkrktd|ttjfnt|S(u Outputs one of the bits used to compose template tags. Since the template system has no concept of "escaping", to display one of the bits used in template tags, you must use the ``{% templatetag %}`` tag. The argument tells which template bit to output: ================== ======= Argument Outputs ================== ======= ``openblock`` ``{%`` ``closeblock`` ``%}`` ``openvariable`` ``{{`` ``closevariable`` ``}}`` ``openbrace`` ``{`` ``closebrace`` ``}`` ``opencomment`` ``{#`` ``closecomment`` ``#}`` ================== ======= iu*'templatetag' statement takes one argumentiu6Invalid templatetag argument: '%s'. Must be one of: %s(RRR^RRRRf(RRRttag((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt templatetags c Cs8|j}t|dkr5td|dn|j|d}g}i}d }|d}t|dkr|ddkr|d}|d }nt|r%xy|D]n}tj|}|stdn|j\} } | r|j| || If ``this_value`` is 175, ``max_value`` is 200, and ``max_width`` is 100, the image in the above example will be 88 pixels wide (because 175/200 = .875; .875 * 100 = 87.5 which is rounded up to 88). In some cases you might want to capture the result of widthratio in a variable. It can be useful for instance in a blocktrans like this:: {% widthratio this_value max_value max_width as width %} {% blocktrans %}The width is: {{ width }}{% endblocktrans %} iiuasu8Invalid syntax in widthratio tag. Expecting 'as' keywordu)widthratio takes at least three argumentsRTN(RR^RDRRR( RRRRtthis_value_exprtmax_value_exprRRTtas_((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyt widthratios     uwithcCs|j}|d}t||dt}|sHtd|dn|rotd|d|dfn|jd}|jtd d |d|S( u Adds one or more values to the context (inside of this block) for caching and easy access. For example:: {% with total=person.some_sql_method %} {{ total }} object{{ total|pluralize }} {% endwith %} Multiple values can be added to the context:: {% with foo=1 bar=2 %} ... {% endwith %} The legacy format of ``{% with person.some_sql_method as total %}`` is still accepted. itsupport_legacyu,%r expected at least one variable assignmentiu %r received an invalid token: %ruendwithR(uendwithN(RRRVRRRRRD(RRRtremaining_bitsRR&((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pytdo_withs   (jR0t __future__RRRJR5t collectionsRRt itertoolsRR=Rt django.confRt django.utilsRRtdjango.utils.encodingRRR R tdjango.utils.lorem_ipsumR R tdjango.utils.safestringR tbaseRRRRRRRRRRRRRRRRRRtdefaultfiltersR RR!tsmartifR"R#tregisterR$R1R2R8RFRNRRRXR}RRRRRRRRRRRRRRRR)RR7RRRRRRRRRRRR RRRRRRRRRR!R%R((((s?/usr/lib/python2.7/site-packages/django/template/defaulttags.pyts   v   ]."  (! X1\    X* /E#D&