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
Resolve various Django 1.8 deprecations #1165
Resolve various Django 1.8 deprecations #1165
Conversation
The app_loading module had to shuffle things a bit. When it was importing the function it raised a [RuntimeError][]. Simply importing the module resolved that. [RuntimeError]: https://gist.github.com/benspaulding/f36eaf483573f8e5f777
The two are not exactly they same, but they are equivalent for Haystack's needs.
There is no need to fallback to importing unittest2 because Django 1.5 is the oldest Django we support, so django.utils.unittest is guaranteed to exist.
At first glance, this looks very nice – thanks! |
Oddly this caused no issue on Django <= 1.7, but it causes numerous errors on Django 1.8.
👍 |
👍 |
@troygrosfield it may be better to merge #1175 into #1165 |
@benspaulding, care to pull in the changes from #1175 to get this to test against django 1.8? Then after that's done I'll close #1175. |
Merge please :D |
I've reshuffled things a bit into https://github.com/acdha/django-haystack/tree/django-1.8 Currently that's down to 4 test failures, all related to the mock models:
|
Sorry I missed the activity here. @acdha Do you need anything further from me regarding this? |
@benspaulding Not immediately, although if you have time to work on the mock models I wouldn't complain. I'm hoping to dig into that again on Friday. |
Okay, I don’t have time in the next few days, but I’ll check back here later and tackle that if it has not already been handled. |
The Django 1.8 branch has merged as of bd8e512 |
There's a release candidate on PyPI now: pip install django-haystack==2.4.0rc1 |
Testing 2.4.0rc1 and still getting these deprecation warnings: /local/lib/python2.7/site-packages/haystack/utils/app_loading.py:7: RemovedInDjango19Warning: The utilities in django.db.models.loading are deprecated in favor of the new application loading system.
from django.db.models.loading import get_app, get_model, get_models
/local/lib/python2.7/site-packages/haystack/utils/app_loading.py:32: RemovedInDjango19Warning: get_app_config(app_label).models_module supersedes get_app(app_label).
app_mod = get_app(label) Last one only comes up with the management commands. |
Created a pull request #1206 with fixes for this |
Thanks – my goal for 2.4 is to have it clean against Django 1.8. If we can On Sat, Jun 6, 2015 at 11:01 AM, Ilan Steemers notifications@github.com
|
I tested #1206 in my own project that was giving the warnings earlier and it's now nice and clean. |
Yes, I'd like to do that for 2.5 along with removing some of the remaining
old Python 2.6 workarounds (e.g. the unittest2 special-casing in the test
suite). If you see anything, feel free to send a pull request even if it's
no more than a comment like "# TODO: remove with Django 1.6 support". I've
been trying to add those as I notice branches for old Python or Django
versions
|
This pull request handles the deprecation in Django 1.8 of:
django.utils.datastructures.SortedDict
django.utils.importlib
django.utils.unittest
For each case it prefers code from the Python stdlib, and if that import fails uses the old Django code. You can see individual commit messages for more information on each change.
This should resolve issue #1162 as well as pull request #1137.