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 renderer argument to render() method of BooleanWidget #923

Merged
merged 3 commits into from
Jul 13, 2018

Conversation

bronsen
Copy link
Contributor

@bronsen bronsen commented Jun 7, 2018

This ought to help against:

.../lib/python3.6/site-packages/django/forms/boundfield.py:36:
RemovedInDjango21Warning: Add the renderer argument to the render() method
of <class 'django_filters.widgets.BooleanWidget'>. It will be mandatory in
Django 2.1.

The renderer argument was added in Django 1.11: https://docs.djangoproject.com/en/2.0/ref/forms/widgets/#django.forms.Widget.render

I have seen this deprecation warning only in association with the BooleanWidget, so only this class was modified.

@codecov-io
Copy link

codecov-io commented Jun 7, 2018

Codecov Report

Merging #923 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #923   +/-   ##
=======================================
  Coverage   98.32%   98.32%           
=======================================
  Files          15       15           
  Lines        1197     1197           
=======================================
  Hits         1177     1177           
  Misses         20       20
Impacted Files Coverage Δ
django_filters/widgets.py 95.27% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 195aafd...77ea984. Read the comment docs.

@michael-k
Copy link
Contributor

I have seen this deprecation warning only in association with the BooleanWidget

@bronsen I guess that's because we don't use the other affected widgets (LinkWidget and BaseCSVWidget).

@bronsen
Copy link
Contributor Author

bronsen commented Jun 20, 2018

So it would make sense to modify the other widgets as well. Good, I shall do so!

@carltongibson carltongibson added this to the Version 2.0 milestone Jul 13, 2018
bronsen and others added 3 commits July 13, 2018 11:22
This ought to help against:
> .../lib/python3.6/site-packages/django/forms/boundfield.py:36:
> RemovedInDjango21Warning: Add the `renderer` argument to the render() method
> of <class 'django_filters.widgets.BooleanWidget'>. It will be mandatory in
> Django 2.1.

The renderer argument was added in Django 1.11: https://docs.djangoproject.com/en/2.0/ref/forms/widgets/#django.forms.Widget.render
This is then passed on to the super() call and also the render() call of the
`surrogate`: it's a TextInput and hence a Widget as well.
@carltongibson carltongibson merged commit 4d295a0 into carltongibson:master Jul 13, 2018
@michael-k michael-k deleted the avoid-deprecation branch July 13, 2018 09:41
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

Successfully merging this pull request may close these issues.

4 participants