-
-
Notifications
You must be signed in to change notification settings - Fork 64
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 gis_admin_deprecations fixer #484
base: main
Are you sure you want to change the base?
Conversation
Oh great. I haven't got time for a full review right now, but at a glance it’s looking good. Can you add a changelog note? Little note for the future - please don't make PRs from the |
Ready! |
This would be a Django 4.0 fixer, because that's when the classes were deprecated. I have moved it there. I looked at the code as of Django 4.0. It looks like we can't blindly rewrite model admin classes to use Those attributes could also come from multiple inheritance, which should also mean that a safe automated fix is impossible. So I think we should add two restrictions:
Do you think you could update to add these, and appropriate tests? |
Sure, I'm going to take care of it, thanks for the review. |
Allows replacement of OSMGeoAdmin and GeoModelAdmin with GISModelAdmin from the same module, those classe were removed on Django 5.0: https://docs.djangoproject.com/en/5.0/releases/5.0/#django-contrib-gis
for more information, see https://pre-commit.ci
Hey, I am just gearing up for a release here, so I took a look at your PR. It needs quite a bit of work to limit the fixer to class definitions and add the above restrictions. I pushed two new, failing tests that represent the restrictions, and will leave the PR like this for now. Let me know if you find time to work on this again (no pressure!). |
Allows replacement of OSMGeoAdmin and GeoModelAdmin with GISModelAdmin from the same module, those classe were removed on Django 5.0: https://docs.djangoproject.com/en/5.0/releases/5.0/#django-contrib-gis