Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example fails initial makemigrations #140

Open
dwadler opened this issue Sep 14, 2023 · 1 comment · May be fixed by #161
Open

Example fails initial makemigrations #140

dwadler opened this issue Sep 14, 2023 · 1 comment · May be fixed by #161

Comments

@dwadler
Copy link

dwadler commented Sep 14, 2023

I'm using Python 3.10 with Django 4.1.2 on Windows 10.

When going to the application folder and running
python manage.py makemigrations

I get the following errors:
File "E:\dwacode\django\django-multiselectfield-master\example\app\models.py", line 66, in
class Book(models.Model):
File "E:\dwacode\django\django-multiselectfield-master\example\app\models.py", line 68, in Book
categories = MultiSelectField(choices=CATEGORY_CHOICES,
File "d:\python10\lib\site-packages\multiselectfield\db\fields.py", line 72, in init
self.validators[0] = MaxValueMultiFieldValidator(self.max_length)
IndexError: list assignment index out of range

I just noticed this is the same as issue #131.
The workaround to set max_length didn't work for me. I always seem to get the error "app.Book.tags: (fields.E009) 'max_length' is too small to fit the longest value in 'choices' (11 characters)." What is "max_length"?

It would be nice when there are keyword options to document what the options are.

@blag
Copy link
Collaborator

blag commented May 24, 2024

Please install directly from GitHub (pip install git+https://github.com/goinnn/django-multiselectfield.git@master) and try again. This was fixed a few days ago.

@mikemanger mikemanger linked a pull request Jul 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants