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

fix force text enconding support for django 4 #341

Closed
wants to merge 3 commits into from

Conversation

diego1996
Copy link

No description provided.

@manelclos
Copy link
Member

manelclos commented Mar 28, 2022

Hi @diego1996 could you please remove the .idea files?

@diego1996
Copy link
Author

Hi @diego1996 can you please remove the .idea files?

Yeah, I hadn't realised.

@codecov
Copy link

codecov bot commented Apr 2, 2022

Codecov Report

Merging #341 (dd911dd) into master (2cff847) will decrease coverage by 4.85%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #341      +/-   ##
==========================================
- Coverage   80.42%   75.57%   -4.86%     
==========================================
  Files           8        8              
  Lines         470      479       +9     
  Branches       68       81      +13     
==========================================
- Hits          378      362      -16     
- Misses         60       82      +22     
- Partials       32       35       +3     
Impacted Files Coverage Δ
smart_selects/form_fields.py 71.69% <100.00%> (-10.31%) ⬇️
smart_selects/utils.py 84.61% <100.00%> (-15.39%) ⬇️
smart_selects/widgets.py 63.53% <100.00%> (-2.76%) ⬇️
smart_selects/views.py 74.02% <0.00%> (-9.10%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2cff847...dd911dd. Read the comment docs.

@manelclos
Copy link
Member

Hi @diego1996,

I had no problems when including Django 4.0 in the tests matrix, see this PR for tests results: #322

Also, Django 4.0 is deprecating force_text, not force_str:
https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0

Can you please elaborate on why this PR is needed?

@luzdealba
Copy link

luzdealba commented Jun 7, 2022

Thanks for this patch, @diego1996!

This PR fixed a Django v4 deprecation issue for me; and it's also written in try/except block that keeps v3 backwards compatibility.

You should consider merging it to master.

Best.

@Blind-Watchmaker
Copy link

Blind-Watchmaker commented Jul 13, 2022

What is the status on this issue? I'm trying to migrate my project to Django 4.0 and django-smart-selects is the only package that is holding me back.

from django.utils.encoding import force_text
ImportError: cannot import name 'force_text' from 'django.utils.encoding'

@manelclos
Copy link
Member

@Blind-Watchmaker according to test results Django main worked but all other versions failed. Patch needs to be adjusted.

@manelclos
Copy link
Member

@diego1996 can you please fix the PR?

@manelclos
Copy link
Member

@Blind-Watchmaker django-smart-selects 1.6.0 is out and features django 4.0 support. Please let me know if you test it. Thanks!

https://pypi.org/project/django-smart-selects/

@diego1996
Copy link
Author

Hola chicos, perdon lo tarde, recien lo veo, que bueno que ya se halla solucionado el problema.

@diego1996
Copy link
Author

Voy a declinar este PR

@diego1996 diego1996 closed this Jul 16, 2022
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.

None yet

5 participants