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

Error on save #36

Closed
mykljohn opened this issue Sep 28, 2015 · 4 comments
Closed

Error on save #36

mykljohn opened this issue Sep 28, 2015 · 4 comments

Comments

@mykljohn
Copy link

mykljohn commented Sep 28, 2015

I'm getting the following error when I save.

Value [u'1', u'6', u'11', u'12'] is not a valid choice.

my model looks like this:

class EvaluationScore(models.Model):
    xSCOREMSGS = (
     ('Vocabulary in General', (
       (1, 'Excellent amount of vocabulary.'),
       (2, 'Good amount of vocabulary.'),
       (3, 'Needs to acquire more vocabulary.'),
       ...
      )
     ),
     ('Verb Meanings', (
       (6, 'Always used the correct verbs.'),
      )
     ),
   )

    scoremsg = MultiSelectField(db_column='ScoreMessage', choices=xSCOREMSGS, max_length=300, blank=True, null=True)

Edit (by blag): Formatted code blocks with GFM.

@thorsonlinguistics
Copy link

I'm getting the same error. In general, choices lists can include named groups, but these don't seem to be supported in django-multiselectfield. I would very much like to have support for these.

@blag
Copy link
Collaborator

blag commented Sep 22, 2016

PR #30 adds support for named groups. Once that PR gets a test added for it I'll merge it in. I am currently extending the tests for Django 1.8+, so if either of you get the time to add a test for that I'd really appreciate it. 😄

@blag
Copy link
Collaborator

blag commented Sep 22, 2016

Done extending tests for Django 1.8+. I'll add a test for named groups and merge in #30 momentarily.

@blag
Copy link
Collaborator

blag commented Sep 23, 2016

Merged in #30. This should now work, unless you're using Django 1.6. I couldn't get it working there.

Closing, but please reopen if you notice any issues.

@blag blag closed this as completed Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants