Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

IntegerDjangoChoices field not working #107

Closed
sanginovs opened this issue Aug 28, 2022 · 4 comments
Closed

IntegerDjangoChoices field not working #107

sanginovs opened this issue Aug 28, 2022 · 4 comments

Comments

@sanginovs
Copy link

sanginovs commented Aug 28, 2022

Hi there
I am trying out this library and been enjoying it so far.
I am running into this issue. Whenever i use IntegerChoicesField in my model and try to create a model using Django admin interface, it throws this error:

Select a valid choice. 1 is not one of the available choices.

Screen Shot 2022-08-28 at 4 07 38 PM

I am using the example code given:

class MyModel(models.Model):
  ...
  class IntegerEnum(models.IntegerChoices):
        FIRST = 1, "First Description"
        SECOND = 2, "Second Description"

    i_field = IntegerChoicesField(
        choices_enum=IntegerEnum,
        default=IntegerEnum.FIRST,
    )


TextChoicesField is working for me but IntegerChoicesField is throwing this error. appreciate any help

@bellini666
Copy link
Member

Hey @sanginovs ,

This is actually an issue with https://github.com/bellini666/django-choices-field, which is also a project of mine =P

I'll try to transfer this issue there and take a look soon to see what is going on. Thanks for the report

@bellini666
Copy link
Member

Hrm, it seems I cannot transfer outside of the organization...

Can you open an issue there?

@sanginovs
Copy link
Author

sure. here we go: bellini666/django-choices-field#5

@bellini666
Copy link
Member

Thank you! I'll close this one

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants