jmrivas86 / django-json-widget

An alternative widget that makes it easy to edit the new Django's field JSONField (PostgreSQL specific model fields)
MIT License
440 stars 88 forks source link

render() error with Django 2.1 #9

Closed michaelqz closed 6 years ago

michaelqz commented 6 years ago

Description

Trying to use the widget in Django 2.1. When using Django 2.0.8 - it works fine. I noticed that froala also had/has this issue-> this may be the cause.

What I Did

Error Occurs: render() got an unexpected keyword argument 'renderer'

Request Method: | GET
-- | --
http://xxxxxxxxxxxxxxxxxxxxxxxxxxx.vfs.cloud9.ap-southeast-1.amazonaws.com/admin/api/inftoken/test_5Fdb59148644095ac4df829c4378125001d3462a6cf4565b54b7d16e90bb/change/
2.1
TypeError
render() got an unexpected keyword argument 'renderer'
/usr/local/lib64/python3.6/site-packages/django/forms/boundfield.py in as_widget, line 93
/usr/bin/python36
3.6.5
['/home/ec2-user/environment/api',  '/usr/lib64/python3.6',  '/usr/lib64/python3.6/lib-dynload',  '/home/ec2-user/.local/lib/python3.6/site-packages',  '/usr/local/lib64/python3.6/site-packages',  '/usr/local/lib/python3.6/site-packages',  '/usr/lib64/python3.6/dist-packages',  '/usr/lib/python3.6/dist-packages']
Sat, 25 Aug 2018 17:38:07 +1000

Trace:

screen

moas commented 6 years ago

render method signature was changed in django 2.1 My solution for quickly fix create your local widget base on django-json-widget and override method

xeor commented 6 years ago

This is causing issues for us as well... @maos.. If you have a fix? Can you share it? Maybe a pull-request?

xeor commented 6 years ago

Fixed this in https://github.com/jmrivas86/django-json-widget/pull/10.. Not sure how it works with old versions of django tho.. At least its a quick fix for someone else

jmrivas86 commented 6 years ago

fixed in PR #8