Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django form fields not well supported #113

Closed
nimasmi opened this issue Jun 16, 2020 · 4 comments
Closed

Django form fields not well supported #113

nimasmi opened this issue Jun 16, 2020 · 4 comments
Labels
django Related to Django templates capabilities enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@nimasmi
Copy link

nimasmi commented Jun 16, 2020

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.

@thibaudcolas
Copy link
Member

Related: #106.

@bcdickinson
Copy link
Collaborator

Also related: #114

@thibaudcolas
Copy link
Member

Mentioned in the docs as of #131.

@thibaudcolas
Copy link
Member

Fixed in #141 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
django Related to Django templates capabilities enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
3 participants