-
-
Notifications
You must be signed in to change notification settings - Fork 119
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 crispy forms example #372
base: main
Are you sure you want to change the base?
Conversation
{% extends "www/base.html" %} | ||
{% load crispy_forms_tags unicorn %} | ||
|
||
{% load crispy_forms_tags %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is unnecessarily loaded twice
<div unicorn:view> | ||
<h2>Crispy</h2> | ||
|
||
{% crispy view.form_class view.form_class.helper %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the view.form_class.helper
can be omitted (if FormHelper attr is called helper
, as you did)
super().__init__(*args, **kwargs) | ||
self.helper = FormHelper() | ||
self.helper.form_id = "id-exampleForm" | ||
self.helper.form_class = "blueForms" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove this line from the unicorn crispy example as well - this is just a CSS that is added, from the crispy example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may work for a DirectView. But if you build a "normal" component which you include using {% unicorn ... %}
, it doesn't find the form_class
variable in the context... This is a major showstopper...
An example with crispy forms for #368 and #362.