阅读背景:

如何在django框架中正确制作自定义过滤器?

来源:互联网 
 # -*- coding: utf-8 -*-
from django import template
register = template.Library()

@register.inclusion_tag('menu/create_minimenu.html', takes_context = True)
def minimenu(context):
....
....
@register.inclusion_tag('menu/create_topmenu.html', takes_context = True)
def topmenu(context):
....
....
@register.filter(name = 'commatodot')
def commatodot(value, arg):
    return str(value).replace(",", '.')
commatodot.isSafe = True
 # -*- coding: utf-8 -*-
from django import tem



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: