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

Support removal of django.core.urlresolvers on Django 2.0 #384

Closed
bityob opened this issue Sep 12, 2023 · 5 comments · Fixed by #404
Closed

Support removal of django.core.urlresolvers on Django 2.0 #384

bityob opened this issue Sep 12, 2023 · 5 comments · Fixed by #404

Comments

@bityob
Copy link

bityob commented Sep 12, 2023

Description

Example -

-from django.core.urlresolvers import reverse
+from django.urls import reverse

The django.core.urlresolvers module is removed in favor of its new location, django.urls.

Source: https://docs.djangoproject.com/en/4.2/releases/2.0/

@OscarVanL
Copy link

OscarVanL commented Nov 15, 2023

Also ran into this when upgrading, which django-upgrade missed :)

@adamchainz
Copy link
Owner

Django 2.0 was released nearly six years ago. At this point, I don’t really care to implement a fixer for the handful of projects that will use it, but would review a PR.

@OscarVanL
Copy link

That's fair enough - to be clear that wasn't a criticism, the tool has been extremely helpful.

@UnknownPlatypus
Copy link
Contributor

That's fair enough - to be clear that wasn't a criticism, the tool has been extremely helpful.

Ye that was not really clear from your previous comment which felt a bit passive-aggressive in my opinion, thanks for the clarification.

I'll submit a PR for review later today to support this, I think this can be easily done following changes made in #295

@OscarVanL
Copy link

I can only apologise for coming across that way. I appreciate all the work you have done to help simplify these upgrades for the community.

I did bump into another couple of things that it could have auto-changed, for example the attribute naming in the ForeignKey class:

  • Switch ForeignKey.rel to ForeignKey.remote_field

  • Switch ForeignKey.rel.to to ForeignKey.remote_field.model

But likewise, as @adamchainz pointed out, it might not be worth adding these to the tool for such an old Django version.

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.

4 participants