Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私が作成したテンプレート ファイルには、次のものが含まれています。
{% if type({'a':1,'b':2}) is dict %} print "Oh Yes!!" {% else %} print "Oh No!!!" {% endif %}
すると、Jinja2 は次のように応答します。
TemplateAssertionError: no test named 'dict'
私はJinja2とFlaskがまったく初めてです
カスタム タイプを取得する場合は、次の例のようにフィールド名にアクセスできます。
{% if 'RelationField' in field.__class__.__name__ %} <div class="col-md-1"> Manage object </div> {% endif %}