Comments (2)
I would also argue for changing the default to allow_unicode=True
in autoslug (despite any Django slug defaults past 1.9, conflicting or otherwise), as disallowing unicode has almost no practical benefit here, and creates needless problems with localization.
from django-autoslug.
Currently, the django-autoslug sets
self.allow_unicode
to the kwargs value and it popsallow_unicode
out the kwargs.django-autoslug/autoslug/fields.py
Line 206 in 3a87391
Since SlugField has
allow_unicode=False
in its init kwargs, and then setsself.allow_unicode=allow_unicode
, you get a situation whereself.allow_unicode
is always false.The solution is to just remove the code where
self.allow_unicode
is set and the kwargs are popped off.
Tried this locally and I actually ran into another error:
Traceback (most recent call last):
File "~/Projects/project/./appname/manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "~/Projects/project/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "~/Projects/project/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 377, in execute
django.setup()
File "~/Projects/project/venv/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "~/Projects/project/venv/lib/python3.9/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "~/Projects/project/venv/lib/python3.9/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/local/Cellar/[email protected]/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "~/Projects/project/appname/inventory/models/__init__.py", line 44, in <module>
from .path import Path
File "~/Projects/project/appname/inventory/models/path.py", line 41, in <module>
from .step import Step
File "~/Projects/project/appname/inventory/models/step.py", line 61, in <module>
class Step(ModelMeta, LocalizedJSONMixin, SiteSoftDeleteModelBase, TimestampModelBase):
File "~/Projects/project/appname/inventory/models/step.py", line 71, in Step
slug = AutoSlugField(populate_from='name', unique=True, always_update=True, allow_unicode=True)
File "~/Projects/project/venv/lib/python3.9/site-packages/autoslug/fields.py", line 214, in __init__
super(SlugField, self).__init__(*args, **kwargs)
File "~/Projects/project/venv/lib/python3.9/site-packages/django/db/models/fields/__init__.py", line 986, in __init__
super().__init__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'allow_unicode'
from django-autoslug.
Related Issues (20)
- AutoSlugField with two charfields HOT 14
- ModuleNotFoundError: No module named 'django.core.urlresolvers' on python 3.6.3 HOT 7
- New release? HOT 12
- Support for Django 2.1.x HOT 11
- unique_with does not work with BooleanFields
- autoslug should work with no arguments
- Include LICENSE and run_tests.py in PyPI sdist
- autoslug 1.9.4 python 3.7.3 django 2.2 import successfull but importlib fails
- How to increase maximum length of AutoSlug field
- Feature request: generating slug from multiple fields HOT 2
- Slug is always regenerated HOT 3
- Uniqueness Manager is always overridden
- Doesn't work with Django 3.1 HOT 2
- error when used model.save() HOT 1
- Lambda functions no longer work with Django migrations
- slug that has a dash at the end initially is changed with next model save
- The letter "ษ,รง,ฤฑ" is not supported
- Unique atribute double sense.
- slug doesn't work peoperly in Farsi even with allow_unicode=True
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-autoslug.