axil's blog
  • Home
  • Categories
  • Tags
  • Archives

Django templates to Jinja2 dictionary

Django templates Jinja2
{{ block.super }} {{ super() }}
{{ forloop.counter }} {{ loop.index }}
{% cycle %} {{ loop.cycle }}
{{ v | default:"-" }} {{ v | default('-', true) }}
{{ v | default_if_none:"-" }} {{ v if v is not None else '-' }}[*]
{{ d | date:"Y-m-d H:m:s" }} {{ d.strftime('%Y-%m-%d %H:%M:%S') }}
[*]http://stackoverflow.com/questions/11146619/suppress-none-output-as-string-in-jinja2
  • « git others
  • Pytest vs standard django tests »
Comments
comments powered by Disqus

Published

Mar 21, 2017

Last Updated

2019-12-16 03:08:48.118176+07:00

Category

software

Tags

  • django 2
  • jinja2 1
  • templates 1
  • Powered by Pelican. Theme: Elegant by Talha Mansoor