Package omeroweb :: Package webadmin :: Package templatetags :: Module custom_tags
[hide private]
[frames] | no frames]

Module custom_tags

source code

Classes [hide private]
  SettingNode
  PluralNode
Functions [hide private]
 
hash(value, key) source code
 
truncateafter(value, arg)
Truncates a string after a given number of chars Argument: Number of chars to truncate after
source code
 
truncatebefor(value, arg)
Truncates a string after a given number of chars Argument: Number of chars to truncate befor
source code
 
shortening(value, arg) source code
 
setting(parser, token) source code
 
do_plural(parser, token)
Usage: {% plural quantity name_singular name_plural %}
source code
Variables [hide private]
  register = template.Library()
  logger = logging.getLogger('custom_tags')

Imports: datetime, traceback, logging, settings, template


Function Details [hide private]

hash(value, key)

source code 
Decorators:
  • @register.filter

truncateafter(value, arg)

source code 

Truncates a string after a given number of chars Argument: Number of chars to truncate after

Decorators:
  • @register.filter

truncatebefor(value, arg)

source code 

Truncates a string after a given number of chars Argument: Number of chars to truncate befor

Decorators:
  • @register.filter

shortening(value, arg)

source code 
Decorators:
  • @register.filter

setting(parser, token)

source code 
Decorators:
  • @register.tag

do_plural(parser, token)

source code 

Usage: {% plural quantity name_singular name_plural %}

This simple version only works with template variable since we will use blocktrans for strings.

Decorators:
  • @register.tag(name= "plural")