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

Docs for |crispy filter imply you can call it with kwargs, is this a mistake? #1144

Open
angusholder opened this issue Apr 12, 2021 · 2 comments

Comments

@angusholder
Copy link

  • Package version: 1.11.2
  • Django version: 3.1
  • Python version: 3.7
  • Template pack: bootstrap3

Description:

The docs for the crispy filter say

In ``bootstrap3`` or ``bootstrap4`` for horizontal forms you can do::
{{ myform|label_class:"col-lg-2",field_class:"col-lg-8" }}
"""

The function itself that implements the filter does accept those args label_class and field_class:

@register.filter(name="crispy")
def as_crispy_form(form, template_pack=TEMPLATE_PACK, label_class="", field_class=""):
"""

Is there any valid way to invoke the filter like that in Django templates? It looks like invalid syntax to me

@Frohus
Copy link

Frohus commented Jul 8, 2022

How come this has no answer/solution/fix yet?

@Hopiu
Copy link

Hopiu commented Jun 12, 2023

Would you be open to a pull request that separates the existing as_crispy_form and as_crispy_field filters into additional tags, while also removing the label_class and field_class kwargs from the filters? If not, could you share your preferred solution for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants