On 30/05/2019 8:22 pm, Mike Dewhirst wrote:
> I just encountered a weird UI glitch[1] in the Admin after upgrading
> to Django 2.2.1
>
> I checked and found the version of jquery I'm using is 1.4.1 and
> figured that has to be contributing to the problem.
>
> The 2.1 release note says "jQuery is upgraded from version 2.2.3 to
> 3.3.1." so I dug deeper in the docs to find how it is upgraded. Can't
> find anything so far. I saw that there are Django Admin javascript
> customisations. So that might complicate matters.
OK - years ago I added my own jQuery to the project and forgot it. On
reading https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#jquery
I just deleted mine. Nothing changed so I assume I originally installed
it incorrectly.
I have now discovered the problem described earlier is more generic as
follows:
1. For any ForeignKey or ManyToManyField in the Admin, if you click
(SHOW) and there is already an existing related record it will open up
nicely. No sign of any bug.
2. For any such related item if you "Add another <whatever>" and click
(SHOW) the Admin will reposition to the top of the page instead of
opening the collapsed fields.
3. I have disabled all my own css
4. There is no js in any of my static dirs - relying entirely on
Django's js.
5. I haven't changed the Admin fieldsets 'classes': ('collapse',),
6. The problem goes away if I downgrade to Django 2.1.8
What code would be interesting in this case?
Any hints?
Thanks
Mike
>
> Is there a best practice for ensuring I keep my projects up to date?
>
> Thanks
>
> Mike
>
> [1] With a m2m (self) adding another instance clicking on the {SHOW}
> link just relocates to the top of the page. Has to be a jQuery thing
> doesn't it?
>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/25d942ee-599b-b1e0-5c60-18f40189f396%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment