clokep / django-querysetsequence

Chain multiple (disparate) QuerySets in Django
https://django-querysetsequence.readthedocs.io/
ISC License
107 stars 25 forks source link

Proxy query attribute. #87

Open ride90 opened 2 years ago

ride90 commented 2 years ago

Hi @clokep ,

Please, take a look at this PR. I saw issues with Django admin (for example https://github.com/clokep/django-querysetsequence/issues/65) and with other packages using querysetsequence . All these issues have pattern: 'QuerySetSequence' object has no attribute 'query'. This PR should fix it and shouldn't break anything.

Please, let me know wdyt 🙏 ?

ride90 commented 2 years ago

Hi @clokep ,

Do you think you'll have time to take a look?

clokep commented 2 years ago

Do you think you'll have time to take a look?

Hopefully soon, but I have been rather busy recently. We removed the query property from QuerySetSequence at some point in the past so will need to check why / when that was done.

Weirdly the QuerySet docs don't even state this as a publicly available property.

ride90 commented 2 years ago

Thank you!

Yes, that's weird, for some reason Django admin uses .query property even in 4.0..

ride90 commented 2 years ago

Hi @clokep , Sorry for bothering you, but will you have a time to check it anytime soon?

Thanks

clokep commented 2 years ago

Hi @clokep , Sorry for bothering you, but will you have a time to check it anytime soon?

I hope to get to it soon, but have been busy as I mentioned above. I maintain this package in my spare time and am not paid to do so; that, unfortunately, puts it below many of my other professional and personal obligations.

clokep commented 2 years ago

Can you add some tests to this?

Do you know if Django admin using these values is considered "wrong" or if they're meant to be public APIs? I can't find any information about what the .query attribute is (from reading the source it is a Query object, but that seems completely undocumented in the Django docs?)

ride90 commented 2 years ago

Hi @clokep , I will provide tests when I have time. Approx 1-2 weeks. Thank you for your review.