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
Fixed #12437 -- Added css_classes to Form._html_output(). #4819
Conversation
@@ -249,7 +250,8 @@ def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_ | |||
'label': '', | |||
'field': '', | |||
'help_text': '', | |||
'html_class_attr': html_class_attr, |
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.
Why did you make the html_class_attr
field empty here?
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.
I saw no real reason for it when creating an empty row for the sole purpose to insert other output. However, I digged through the tickets I could find on this (3512, 3686, 3515), and looked at the original commit adding it, and it seems like it was written like that on purpose, although I find no reference to why. So I just pushed a new commit that reverts it, doesn't make a difference for this new patch :)
|
||
def test_field_with_css_class(self): | ||
class SomeForm(Form): | ||
some_field = CharField(widget=TextInput(attrs={'class': 'first_name_id'})) |
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.
is widget=...
important for the test?
I think the widget was just a leftover from my dev process, I've removed it now and squashed some of the commits. Should I ideally squash everything into one commit? |
Yes, please. You can also use the commit message from the title of the pull request (see the patch review checklist for the commit message guidelines). |
I've squashed everything into one commit with a better message, will pay more attention to this in the future. |
merged in 1884bf8, thanks! |
See ticket: https://code.djangoproject.com/ticket/12437