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

Set label_class or field_class on as_crispy_field #102

Open
areski opened this issue Jul 8, 2021 · 1 comment
Open

Set label_class or field_class on as_crispy_field #102

areski opened this issue Jul 8, 2021 · 1 comment

Comments

@areski
Copy link
Contributor

areski commented Jul 8, 2021

Hi,

I'm trying to figure out if it's possible to set the field_class when using as_crispy_field, for instance when calling the following:
{{ form.field|as_crispy_field:"tailwind" }}

Reference to as_crispy_field in the code:

def as_crispy_field(field, template_pack=TEMPLATE_PACK, label_class="", field_class=""):

as_crispy_field is a django filter, so according to django documentation it should not be possible to pass multi arguments, which only work with template tag.

As the method as_crispy_field has those 2 arguments in the function definition, maybe I'm missing something.
Any pointer would be appreciated.

@SebastianDix
Copy link

I think this is simply a bug, if they wanted to use multiple arguments such as in the builtin filter "yesno (https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#yesno) then they would need to split the first argument by commas for example

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

2 participants