A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/torchbox/django-pattern-library/issues/113 below:

Django form fields not well supported · Issue #113 · torchbox/django-pattern-library · GitHub

If a template contains {% for field in form %} or even {% if form %}, then it's easy enough to render in django-pattern-library so long as we force the form to be null in the YAML context, and are happy not to have the form.

If the form is rendered explicitly by field names, then it requires a lot more work, and support for this is not documented. I had a quick go, but my template has things like:

            {% include "patterns/molecules/form_field.html" with field=form.email %}

and that template has a custom filter: {{ field|field_type }} which necessitated YAML like:

  form:
    email:
      bound_field:
        field:
          widget:
            class:
              __name__: char_field

I didn't go much further, because these is even more convoluted markup in my chosen template, and it wasn't a high enough priority.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4