Ticket #1162: defaultfilters.diff

File defaultfilters.diff, 700 bytes (added by nkeric@…, 19 years ago)

added range0 and range1 filter

  • defaultfilters.py

     
    433433    from pprint import pformat
    434434    return pformat(value)
    435435
     436def range0(value):
     437    "A python style range() function, 0-index"
     438    return range(value)
     439
     440def range1(value):
     441    "A python style range() function, 1-index"
     442    return range(1, value + 1)
     443
    436444# Syntax: register.filter(name of filter, callback)
    437445register.filter(add)
    438446register.filter(addslashes)
     
    482490register.filter(wordcount)
    483491register.filter(wordwrap)
    484492register.filter(yesno)
     493register.filter(range0)
     494register.filter(range1)
Back to Top