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

Add a way to globally control where a form field name is placed relative to its input #1134

Open
hmpf opened this issue Jan 16, 2025 · 0 comments
Labels
frontend Affects frontend polish Nice to have task

Comments

@hmpf
Copy link
Contributor

hmpf commented Jan 16, 2025

We want to be able to do "{{ form }} or "{{ form.as_div }}" in our templates. as_div in particular uses the template "django/forms/div.html".

We can override any default django form specific template via argus.htmx if we add "django.forms" to argus.htmx.appconfig._app_settings (after "argus.htmx"), and set FORM_RENDERER = 'django.forms.renderers.TemplatesSetting' in the same place.

Just for as_div the easiest/most robustly way is probably with a form mixin with either our own "as_div", or reuse "as_div" and use our own template by setting "template_name_div" on the form.

Discovered during #1110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Affects frontend polish Nice to have task
Projects
Status: 🔖 Ready
Development

No branches or pull requests

1 participant