
具有上下文变量参数的Django自定义模板标记
我有一个自定义模板标签,显示日历.我想根据动态值填充日历上的某些项目. 这是标签: @register.inclusion_tag(website/_calendar.html)def calendar_table(post): post=int(post) imp=IMP.objects.filter(post__pk=post) if imp:
我有一个自定义模板标签,显示日历.我想根据动态值填充日历上的某些项目. 这是标签: @register.inclusion_tag(website/_calendar.html)def calendar_table(post): post=int(post) imp=IMP.objects.filter(post__pk=post) if imp: