Django-grappelli: Django 1.10 support?

Created on 29 Sep 2016  Β·  24Comments  Β·  Source: sehmaschine/django-grappelli

Has Django 1.10 support been looked at yet, and are there any incompatibilities? Happy to help with it.

Most helpful comment

just released 2.9.1 (compatible with Django 1.10)

All 24 comments

see branch stable/2.9.x ... should work. I'm just waiting for some feedback before the actual release.

Ok, any testing/feedback I can do?

you can checkout that branch and just play around. tests look fine, but I'm pretty sure there are still minor glitches. and if you do not find any bugs, that's a useful feedback as well.

I've been looking around a bit. Django 1.10 upgraded from jQuery 2.1.4 to 2.2.3, but Grappelli 2.9.x is currently replacing that with version 2.1.4 again - shouldn't it be upgraded? πŸ˜„

Other than that I have spotted some other issues that seem to be in our custom javascript, but will update if any of these look like they're in Grappelli. Thx.

@adamchainz We don't necessarily follow the jQuery updates of Django, but I'll take a look.

Ok, just seemed like you were in sync with 1.9 there. Also Grappelli replaces django.jQuery so I thought it would be following it.

In fact b1963500349f262160659d62b92eb8e72f88be17 copied in jQuery 2.2.3 (rather than just dropping the file to prevent static 'shadowing' of django.contrib.admin), but it still shadows jquery.init.js so the end result is that django.jQuery is the 2.1.4 version but window.jQuery is the 2.2.3. :thinking:

The latest grappelli master works fine on my end with Django 1.10.2.

My only grief is the delete URL in the change_form: the template doesn't seem to receive a context, so the URL is simply "delete/", so the link resolves to "admin/app_name/model_name/pk/change/delete/" instead of ".../pk/delete".
The problem may lie with fsm-admin.

Django==1.10.2
django-grappelli==2.8.2
django-fsm==2.4.0
django-fsm-admin==1.2.3
django-fsm-log==1.3.0

@florianm master is not compatible with django 1.10 – take a look at stable/2.9.x instead.

@sehmaschine thanks for the heads up! Running stable/2.9.x now - the problem with delete link persists, but coming from django-fsm-admin's submit template which does not seem to be receiving the request context.

@sehmaschine bump - any idea about the jQuery changes?

@adamchainz what exactly is the issue with jQuery (besides using a different version compared with the Django admin)?

Read my above comment, I don't think I can explain it any better

I've been looking around a bit. Django 1.10 upgraded from jQuery 2.1.4 to 2.2.3, but Grappelli 2.9.x is currently replacing that with version 2.1.4 again - shouldn't it be upgraded?

thatΒ΄s true. but I donΒ΄t see any issues here.

In fact b196350 copied in jQuery 2.2.3 (rather than just dropping the file to prevent static 'shadowing' of django.contrib.admin), but it still shadows jquery.init.js so the end result is that django.jQuery is the 2.1.4 version but window.jQuery is the 2.2.3.

I'm sorry, but I do not understand this comment.

In grappelli 2.8.x the vendored jQuery files are just comments: https://github.com/sehmaschine/django-grappelli/blob/master/grappelli/static/admin/js/vendor/jquery/jquery.js . This claims to be to 'shadow' the file in Django, i.e. replace the one in django.contrib.admin. It does this because Django's staticfiles gives priority to grappelli as it's first in INSTALLED_APPS as per the install guide. Grappelli 2.8.x then replaces django.jQuery with the version it ships, which is 2.1.4 - the same as what Django 1.9 ships: https://github.com/django/django/blob/stable/1.9.x/django/contrib/admin/static/admin/js/vendor/jquery/jquery.js

In 2.9.x Grappelli has removed the comments in the vendored jQuery file and instead committed jQuery 2.2.3. This is unnecessary - dropping the files (jquery.js and jquery.min.js) would suffice as Django 1.10 ships jQuery 2.2.3 in the same file, and the 'shadowing' would thus be no longer required. However 2.9.x still ships jQuery 2.1.4 and still replaces django.jQuery with it. So it's downgrading Django's version of jQuery, even after what appears to be attempts to upgrade to 2.2.3. This is a potential source of bugs as Django's jQuery code is only tested against 2.2.3.

I'd recommend just always using Django's version of jQuery in Grappelli, especially since in 2.8.x that was what was effectively done by shipping 2.1.4, the same version that Django shipped.

so we just need to add the comments again, right? additionally, we could also update the jquery version.

I'm making a PR that just removes the files and uses Django's jQuery

Nevertheless, the popup window for selecting FK items is still buggy on stable/2.9.x.
When clicking the PK of the selected item, the item is open for modification instead of putting data in field.

@debnet I'm not able to reproduce this. popups work fine with my setup. are you sure that you're using the updated files?

just released 2.9.1 (compatible with Django 1.10)

Trying to update my Dev setup to verify Grapelli changes, I ran into a really neat problem with File Browser!

PIP made me update it to V9. Then a PIP CHECK told me File Browser was not recommended for my new Grappelli version. So I told PIP to update FB - thinking there would be a new version with updated requirements specs. And it DOWNGRADED my Grappelli back to 2.8!!! Below is the console session.

(py27dj110)rcooke@developer1:~/source/GNVO/django-DEV$ pip check
django-filebrowser 3.7.2 has requirement django-grappelli<2.9,>=2.8, but you have django-grappelli 2.9.1.


(py27dj110)rcooke@developer1:~/source/GNVO/django-DEV$ pip show django-filebrowser
Name: django-filebrowser
Version: 3.7.2
Summary: Media-Management with Grappelli
Home-page: http://django-filebrowser.readthedocs.org
Author: Patrick Kranzlmueller, Axel Swoboda (vonautomatisch)
Author-email: [email protected]
License: BSD
Location: /home/rcooke/.virtualenvs/py27dj110/lib/python2.7/site-packages
Requires: django-grappelli


(py27dj110)rcooke@developer1:~/source/GNVO/django-DEV$ pip install --upgrade django-filebrowser
Requirement already up-to-date: django-filebrowser in /home/rcooke/.virtualenvs/py27dj110/lib/python2.7/site-packages
Collecting django-grappelli<2.9,>=2.8 (from django-filebrowser)
  Downloading django_grappelli-2.8.3-py2.py3-none-any.whl (1.6MB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.6MB 594kB/s 
Installing collected packages: django-grappelli
  Found existing installation: django-grappelli 2.9.1
    Uninstalling django-grappelli-2.9.1:
      Successfully uninstalled django-grappelli-2.9.1
Successfully installed django-grappelli-2.8.3
(py27dj110)rcooke@developer1:~/source/GNVO/django-DEV$ 

That's because django-filebrowser depends on grappelli < 2.9 as you can
see in the line:

Collecting django-grappelli<2.9,>=2.8 (from django-filebrowser)

That's a problem with filebrowser not grappelli, report the issue there

On 15 November 2016 at 14:25, Richard Cooke [email protected]
wrote:

Trying to update my Dev setup to verify Grapelli changes, I ran into a
really neat problem with File Browser!

PIP made me update it to V9. Then a PIP CHECK told me File Browser was not
recommended for my new Grappelli version. So I told PIP to update FB -
thinking there would be a new version with updated requirements specs. And
it DOWNGRADED my Grappelli back to 2.8!!! Below is the console session.

`(py27dj110)rcooke@developer1:~/source/GNVO/django-DEV$ pip check
django-filebrowser 3.7.2 has requirement django-grappelli<2.9,>=2.8, but
you have django-grappelli 2.9.1.

(py27dj110)rcooke@developer1:~/source/GNVO/django-DEV$ pip show
django-filebrowser
Name: django-filebrowser
Version: 3.7.2
Summary: Media-Management with Grappelli
Home-page: http://django-filebrowser.readthedocs.org
Author: Patrick Kranzlmueller, Axel Swoboda (vonautomatisch)
Author-email: [email protected]
License: BSD
Location: /home/rcooke/.virtualenvs/py27dj110/lib/python2.7/site-packages
Requires: django-grappelli

(py27dj110)rcooke@developer1:~/source/GNVO/django-DEV$ pip install
--upgrade django-filebrowser
Requirement already up-to-date: django-filebrowser in
/home/rcooke/.virtualenvs/py27dj110/lib/python2.7/site-packages
Collecting django-grappelli<2.9,>=2.8 (from django-filebrowser)
Downloading django_grappelli-2.8.3-py2.py3-none-any.whl (1.6MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.6MB 594kB/s
Installing collected packages: django-grappelli
Found existing installation: django-grappelli 2.9.1
Uninstalling django-grappelli-2.9.1:
Successfully uninstalled django-grappelli-2.9.1
Successfully installed django-grappelli-2.8.3
(py27dj110)rcooke@developer1:~/source/GNVO/django-DEV$
`

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/sehmaschine/django-grappelli/issues/783#issuecomment-260654333,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA0WCa-9Z1TvuXgKVcIovXIVyjJXwHOKks5q-cDbgaJpZM4KJ-uV
.

Adam

I posted that here as a warning to others looking to update their setups. If one was not aware of this, and did a generic "update all" packages, Grappelli would likely wind up staying at 2.8.x - depending upon the order of the update checks.

I also posted it to FileBrowser.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ndrsn picture ndrsn  Β·  31Comments

asfaltboy picture asfaltboy  Β·  11Comments

FrozenAlex picture FrozenAlex  Β·  15Comments

johncpang picture johncpang  Β·  4Comments

bob-r picture bob-r  Β·  9Comments