Django-autocomplete-light: render() got an unexpected keyword argument 'renderer'

Created on 2 Aug 2018  ·  17Comments  ·  Source: yourlabs/django-autocomplete-light

Hello everyone, update to Django 2.1 today.

It seems that the problem described in this post: fabiocaccamo/django-admin-interface#34 is also affecting our beloved django-autocomplete-light.

In all the forms that I use the widgets, I get this error:
render () got an unexpected keyword argument 'renderer'

Could someone guide me to solve this error?

Most helpful comment

same problem

All 17 comments

Im still experiencing the same problem to Django 2.1

Go back to 2.0.8, is the latest release before 2.1

El mié, ago 8, 2018 10:51 PM, Kim S. Sunga notifications@github.com
escribió:

Im still experiencing the same problem to Django 2.1


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/yourlabs/django-autocomplete-light/issues/1026#issuecomment-411623977,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AWfpsaeUqht4qL1TLAgDbUvnEOMDukHfks5uO6qdgaJpZM4VraLW
.

same problem

+1

я пока просто закомментировал эту строчку, вроде все работает!
I have just commented out this line, everything works!

+1

I also experienced this error when upgrading from django 2.0.X to 2.1. Upon downgrading back to 2.0.8, the problem disappeared.

@gnarizzy You made my day. I have been trying to figure this out with with no luck.

fixed by @monim67 in #1028

I'm now using Django 2.1.1. No problem so far

On Fri, Sep 7, 2018 at 11:38 AM ∞ notifications@github.com wrote:

Closed #1026
https://github.com/yourlabs/django-autocomplete-light/issues/1026.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/yourlabs/django-autocomplete-light/issues/1026#event-1831926552,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ada0zHt9NTQfUAkyanimnd2SSS85LRQmks5uYeongaJpZM4VraLW
.

2.1.1 and 2.1.2 do not work for me. I downgraded back to 2.0.8 and the problem has disapeared.

got the same problem after integrating trix, apparently trix is outdated

What I did is created a custom widget on the default GooglePointFieldWidget. Added renderer as None.

class CustomGooglePointWidget(GooglePointFieldWidget):

def render(self, name, value, attrs=None, renderer=None):
    if not attrs:
        attrs = dict()

    field_value = {}
    if isinstance(value, Point):
        field_value["lng"] = value.x
        field_value["lat"] = value.y

    if value and isinstance(value, six.string_types):
        coordinates = self.deserialize(value)
        field_value["lng"] = getattr(coordinates, "x", None)
        field_value["lat"] = getattr(coordinates, "y", None)

    extra_attrs = {
        "options": self.map_options(),
        "field_value": json.dumps(field_value)
    }

    attrs.update(extra_attrs)
    self.as_super = super(GooglePointFieldWidget, self)
    return self.as_super.render(name, value, attrs)

I got this problem on django 2.1.5 .down to 2.0 it's fine.

@gvizquel Thanks for the fix! :smile:

I'm still experiencing the same problem on django 2.1.7.

This is due to an error when integrating DjangoUeditor. We need to modify the :boundfield.py file in the virtual environment:
.virtualenvs/virtual environment file /lib/python3.5/site-packages/django/forms/boundfield.py

89        return widget.render(
90            name=self.html_initial_name if only_initial else self.html_name,
91            value=self.value(),
92            attrs=attrs,
93            # renderer=self.form.renderer, (commented at line 93, it will run normally)
94        )
Was this page helpful?
0 / 5 - 0 ratings