-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Fixes issue 455 (incompatability with django master at 3.2) #461
Fixes issue 455 (incompatability with django master at 3.2) #461
Conversation
Codecov Report
@@ Coverage Diff @@
## master #461 +/- ##
==========================================
+ Coverage 88.80% 88.83% +0.02%
==========================================
Files 34 34
Lines 2609 2616 +7
==========================================
+ Hits 2317 2324 +7
Misses 292 292
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handling of the different django API looks perfectly reasonable to me
I would just indent the if get_django_version() ...
in line with the other class methods, but it's a matter of taste
I'm not sure we can indent that line it since it's operating on the class, I'm happy for you to push it up if you know how to make it work inline with the class definition 👍 |
Sorry, the diff misled me to think you conditionally defined the method. Something like the snippet below in the class body would work if get_django_version() >= "3.2":
def _filter_or_exclude(....):
....
else:
def _filter_or_exclude(....):
.... See this example https://github.com/divio/django-filer/pull/1201/files#diff-71f149c65e62bb3b8fdcd50b4b00a845R105 |
But I would wait for @chrisglass input to check if he agrees on the approach |
Yeah cool, I never knew that was a thing. I much prefer that way so related methods are together and it's not a shock for future devs that there's a 2 definitions of |
@chrisglass How do you feel about this solution? |
This looks good - I'm a little bit sad that we have to have a conditional function declaration here, but since the signature changed upstream there's not much else we can do about it. I'll merge this now, thanks a lot for the contribution! 👍 |
Fixes #455
Raised on django master in django/django@9c9a3fe
I'd like specific feedback on