Closed Gwildor closed 4 years ago
I confirm the problem on django 1.11.4 floppyforms/widgets.py in render(self, name, value, attrs, **kwargs) get_context() got an unexpected keyword argument 'renderer' on django==1.11.2 works fine!
+1
Btw, we don't use floppyforms anymore.
+1
Nice job @johnnyrockets @gregmuellegger - Please fix and upload a new version on pip repository.
Has the issue been fixed?
+1
+1
+1
+1
+1
+1
+1
+1
Is there any chance of including the fix in a new release? Or is there any proposed official temp workaround?
I am now upgrading an older Django to 2.0. The project makes use of floppyforms to a great extent, so this would really be a requirement.
THanks
Please!
I have simillar problem on django 2.0.2 , please help somebody
Fix 193 from @manojrege works for me!
@lokkomokko try @manojrege's fix, it worked for me on django 2.0.2
+1
@manojrege Thanks man!
+1
There is a larger issue here that shows up in django >= 2.1. All but one of the of the render
methods in widgets.py need to have , renderer=None
added to their argument list. E.g.
def render(self, name, value, attrs=None, choices=()):
needs to be
def render(self, name, value, attrs=None, choices=(), renderer=None):
I know that this is an old issue but to circumvent the problem i monkeypatched like this:
from floppyforms import widgets
old_render = widgets.Input.render
def patched_render(self, name, value, attrs=None, **kwargs):
renderer = kwargs.pop('renderer', None)
if renderer:
from floppyforms.compat import flatten_contexts
template_name = kwargs.pop('template_name', None)
if template_name is None:
template_name = self.template_name
context = self.get_context(name, value, attrs=attrs or {}, **kwargs)
context = flatten_contexts(self.context_instance, context)
return renderer.render(template_name, context)
else:
return old_render(self, name, value, attrs, **kwargs)
widgets.Input.render = patched_render
I know this is ugly but as a quick fix it does its job.
There is a similar issues with passing extra attrs
for the widgets.
We use django-floppyforms in a few of our projects and would greatly appreciate a fix that works with Python 3 and Django 2.2. If you need any help updating this project I offer my assistance.
I believe that all of y'all's issues should be fixed with the latest release (1.8.0
).
If you hit any issues still with that release, please re-open this issue/create a new issue and we'll see what we can do
The error in the title is raised for Floppyforms widgets on Django 1.11.3 because of the change in this ticket (code here). The solution for now is to stay on 1.11.2 or lower until this is fixed in Floppyforms.