Comments (3)
I have released these fixes in a new version. Thanks for the report and the help!
from taggit-selectize.
Thanks for detailed issue report. That is definitely bug, @nshafer do you have any pointers for OP?
from taggit-selectize.
First, I apologize for not getting back to you.. I've just moved cities and things were really hectic.
So, I just looked into this, and was able to replicate it. With further digging, I've come across the basic problem that Selectize and default Taggit have differing philosophies when it comes to supporting tags separated by either commas or spaces.
Selectize has a default delimiter setting of of a comma, in the delimiter
setting. With taggit-selectize, we do not change this setting nor do we expose it to the user through our own settings. I think I'll change this.
Taggit, on the other hand, has a default string-to-tag parser that tries to be intelligent and parse tags separated by spaces if there are no quotes or commas in the string. So the problem here is that according to Selectize, the string "foo bar" is a single tag, so no commas or quotes are necessary. This then gets posted to Taggit, which says, "hey there, no commas, no quotes, this must be a space-separated tag list" and then pulls each word out separately as a distinct tag.
So the good news is that this is fixable, but really only by the user changing Taggit's default configuration.
Taggit has a setting that allows you to override the default tag parser, documented here. Their example creates a super naive parser that causes other problems with how Selectize works, so instead I have adapted a version of their tag parser that will still properly work with quotes and commas, but doesn't ever treat spaces as a separator.
I have included this function in taggit_selectize.utils.parse_tags
and updated the README to reflect the extra step of configuring Taggit to use it during installation.
TAGGIT_TAGS_FROM_STRING = 'taggit_selectize.utils.parse_tags'
I am going to make another change or two and have Nar push a new version to PyPi.
from taggit-selectize.
Related Issues (20)
- Order by length of tag name HOT 3
- with DRF HOT 1
- taggit-selectize in templates HOT 14
- Does this only work in admin ? HOT 10
- Safari form submission broken HOT 1
- Update selectize.js to latest version HOT 2
- Is the Example App Compatible with Django 2.1.5? HOT 1
- Incompatible with django-taggit 1.0
- ModuleNotFoundError: No module named 'taggit-selectize' HOT 2
- Django 3.0 support HOT 2
- put jQuery in top of base_site.html
- Uncaught TypeError: $(...).selectize is not a function
- Make taggit-selectize responsive and add a new tag with comma (on mobile)
- Using taggit-selectize with django 3
- close_after_select config value
- RemovedInDjango40Warning: force_text() is deprecated in favor of force_str(). HOT 1
- RemovedInDjango40Warning: django.conf.urls.url() is deprecated in favor of django.urls.re_path() HOT 1
- Theming support
- Example app does not contain sample template
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 taggit-selectize.