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

Add support for official Django versions and drop EOL Python & Django #76

Merged
merged 2 commits into from
Jul 24, 2023

Conversation

irtazaakram
Copy link
Contributor

Hi

I've made this PR that

can we also have a new release after this PR is merged?

Thanks,

@codecov-commenter
Copy link

codecov-commenter commented Jul 24, 2023

Codecov Report

Merging #76 (37d2f7c) into master (c156310) will not change coverage.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##           master      #76   +/-   ##
=======================================
  Coverage   96.74%   96.74%           
=======================================
  Files           2        2           
  Lines         123      123           
  Branches       23       17    -6     
=======================================
  Hits          119      119           
  Misses          3        3           
  Partials        1        1           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sergei-maertens
Copy link
Collaborator

Thank you! I should be able to release a new version today. I have been meaning to add docs on how to replace this library with Django's built in choices too. Can I ask what your use case is still, now that django has them built in? What features are you using that Django doesn't have?

@irtazaakram
Copy link
Contributor Author

Hi @sergei-maertens,

Thank you for quick response on this PR. This update is related to ongoing effort to update Django to 4.2 on openedx.
Django-choices is extensively used mainly in the course-discovery & taxonomy-connector.

Thanks,

@sergei-maertens
Copy link
Collaborator

@irtazaakram thank you for the quick feedback too! That looks like some pretty straight-forward usage - are you making use of DjangoChoices.values / DjangoChoices.labels / DjangoChoices.get_choice and the likes? If not, I think it should be fairly straight forward to add a helper to the library to generate the equivalent Django's models.TextChoices and family from the definitions so you could pretty much copy and paste the replacements.

@sergei-maertens sergei-maertens merged commit 263ae32 into bigjason:master Jul 24, 2023
@irtazaakram
Copy link
Contributor Author

Thank you for the insights @sergei-maertens. I will share the PR to replace Django-choices with builtins for both repos with you.

& Thank you for merging this PR 🎉

@irtazaakram irtazaakram deleted the update branch July 24, 2023 07:56
@sergei-maertens
Copy link
Collaborator

@irtazaakram I think I phrased it badly - I plan to work on and release version 2.0 in the next few hours, which will include a management command to generate the code to convert to native Django choices. That should help existing projects migrate away from the django-choices library. It'd will probably save you a bunch of manual labor so I'd recommend waiting for that.

@irtazaakram
Copy link
Contributor Author

oh ok .. Thanks @sergei-maertens. I'll wait for that then.

@sergei-maertens
Copy link
Collaborator

@irtazaakram it is done - version 2.0.0 is now on PyPI and the documentation on how to migrate can be found here: https://django-choices.readthedocs.io/en/latest/migrating.html

@irtazaakram
Copy link
Contributor Author

Thank you @sergei-maertens 🎉

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 this pull request may close these issues.

3 participants