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

Compatibility issue with django 1.11 #27

Open
omarwllorente opened this issue Mar 6, 2018 · 1 comment
Open

Compatibility issue with django 1.11 #27

omarwllorente opened this issue Mar 6, 2018 · 1 comment

Comments

@omarwllorente
Copy link

omarwllorente commented Mar 6, 2018

When upgrading to django 1.11 an error arises: build_attrs() unexpected keyword 'type'.

It happened in other django related software, as you can see:
django-ckeditor/django-ckeditor#375
jazzband/django-sortedm2m#107

It is easily solved by this recoding in widgets.py:

--- /usr/local/lib/python2.7/dist-packages/splitjson/widgets.py.orig    2018-03-07 13:16:58.544426000 +0100
+++ /usr/local/lib/python2.7/dist-packages/splitjson/widgets.py 2018-03-07 13:24:15.904531209 +0100
@@ -23,8 +23,9 @@
         Widget.__init__(self, attrs)

     def _as_text_field(self, name, key, value, is_sub=False):
-        attrs = self.build_attrs(self.attrs, type='text',
-                                 name="%s%s%s" % (name, self.separator, key))
+        attrs = self.build_attrs(self.attrs)
+        attrs['type'] = 'text'
+        attrs['name'] = "%s%s%s" % (name, self.separator, key)
         attrs['value'] = utils.encoding.force_unicode(value)
         attrs['id'] = attrs.get('name', None)
         return u""" <label for="%s">%s:</label>

It would be great if you can update your code to solve the problem. Thanks!

@zahid-arbisoft
Copy link

zahid-arbisoft commented Apr 26, 2019

This change must be added to code. @omarwllorente Thank you

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

No branches or pull requests

2 participants