Changes between Initial Version and Version 1 of Ticket #911


Ignore:
Timestamp:
Nov 25, 2005, 3:45:20 PM (19 years ago)
Author:
Adrian Holovaty
Comment:

(Fixed formatting in description.)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #911 – Description

    initial v1  
    99At the top of a tag/filter library,
    1010do
    11 
     11{{{
    1212import django.core.template
    1313
    1414register = template.Library()
    15 
     15}}}
    1616then to register tags or filters, use
    17 
     17{{{
    1818register.tag('name', func)
    1919register.filter('name', func, False)
    20 
     20}}}
    2121In tags, resolve_variable_with_filters is gone.
    2222The functionality is split in two.
    2323In your compile function, do
    24 
     24{{{
    2525filter_expr =  parser.compile(filter_string)
    26 
     26}}}
    2727pass this into your node class as usual.
    2828
    2929in render, do
    30 
     30{{{
    3131filter_result = filter_expr.resolve(context)
    32 
     32}}}
    3333instead of resolve_variable_with_filters.
    3434
    35 the tag decorators are also now members of the library class, so do
     35the tag decorators are also now members of the library class, so do
     36{{{
    3637@register.simple_tag
     38}}}
    3739
    3840and
    39 
     41{{{
    4042@register.inclusion_tag('cow_detail')
    41 
     43}}}
    4244for those.
    4345
Back to Top