Comments (9)
I do not have the time to investigate further.
Apprantly you rely on django-sortedm2m to have jQuery, that is a mistake.
I do not rely, it's the jquery-ui shipped in django-sortedm2m which expects a global jQuery.
At the moment the latest master of this package seems broken to me, I highly advise to not release it to pypi until the problem is fixed to avoid breaking existing applications that rely on it.
from django-sortedm2m.
The very first error comes from jquery-ui.js
it is probably linked to the fact that there is several jquery.js
or several jquery-ui.js
that bring some trouble.
Can you change that line:
And replace the ternary operation with simply django.jQuery
?
Otherwise, if it does not work, you will need to provide an example code that reproduce the problem.
Have you tried the latest master in one of your applications?
Yes.
from django-sortedm2m.
@amirouche, that didn't work.
Reintroducing these lines which were removed fixes it: b8e8326#diff-1a1e3ea5b934607f6eeba01fbf28dff55ed43758ded45b83c1b89e44c26effa5L1-L3
In order to replicate the issue, these instructions can be followed:
https://github.com/openwisp/openwisp-controller#installing-for-development
Then, make sure the latest master of django-sortedm2m is installed in the virtual env.
Then, the error shows up in http://localhost:8000/admin/config/device/add/
.
It does show up also in the edit page, although a device configuration (inline object) and some templates need to be created for the widget to show up.
from django-sortedm2m.
The lines removed were replaced by the ternary operator at the end, which seems to me like the correct idiom, that I picked up in Django or something like that.
In order to replicate the issue, these instructions can be followed:
https://github.com/openwisp/openwisp-controller#installing-for-developmentThen, make sure the latest master of django-sortedm2m is installed in the virtual env.
I will look into this tomorrow.
from django-sortedm2m.
The lines removed were replaced by the ternary operator at the end, which seems to me like the correct idiom, that I picked up in Django or something like that.
Yes but jQuery ui expects to find a global jQuery
object, which now is not available. Are you sure you're not getting the same issue in your application? If you're not seeing this issue, I suggest to double check if you don't have another line of JS somewhere defining a global jQuery object.
In the meanwhile I have opened #176, which I think it's the safest choice for maintaining backward compatibility and avoid problems in existing applications using this package.
from django-sortedm2m.
from django-sortedm2m.
Yes, I have another jQuery in the global namespace. I disagree with the backward compatibility thing. This is a bug, not a feature.
The solution used previously was not elegant but if we don't want to break the package we'll either have to find a better solution or rollback that change. I have not strong opinions, I only want this widget to keep working as it did in the last version.
from django-sortedm2m.
I do not have the time to investigate further.
Apprantly you rely on django-sortedm2m to have jQuery, that is a mistake.
from django-sortedm2m.
Sorry for the noise, I completely forgot sortedm2m rely on jqueryui!
Indeed #176 must be merged before a release.
from django-sortedm2m.
Related Issues (20)
- Migration from ManyToManyField to SortedManyToManyField
- German translation missing in pypi package HOT 3
- 3.0.1 seems to brake drag&drop ordering HOT 3
- Popup for creating new entity for relational field is not closing due to js error HOT 3
- Drag'n'drop sorting with select2 autocomplete widget
- SortedManyToManyField. Getting an error HOT 4
- Pytest error HOT 1
- [feature] Allow overriding/customizing widget
- Replace Travis HOT 1
- Use drag and drop in custom form? HOT 3
- Can't load SortedManyToManyField
- Error when using "through" intermediate model HOT 3
- New release with support for django 3.2 HOT 6
- Django SortedManyToManyField does not save order in reverse relation
- Can not use django migrations to rename field. HOT 3
- issue running Tox/tests
- Drag and drop is not working in StackInline admin HOT 1
- The module recreates the rows of the intermediate table HOT 1
- Broke in Django 5.0? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-sortedm2m.