python-redmine icon indicating copy to clipboard operation
python-redmine copied to clipboard

There should be a method for resultset that is equivalent to django's `prefetch_related`

Open alegend4u opened this issue 2 years ago • 1 comments

Just as Django's prefetch_related method, there should be implemented a method to accomplish the same so that all resources along with related ones can be received all at once rather than iterating over the related fields and lazy loading each of them.

alegend4u avatar Jan 13 '22 16:01 alegend4u

Hi @alegend4u

Apologies for the late reply.

I thought about it, but Redmine's REST API is a bit special in terms of how it works with associated data. You can already kind of get a prefetch_related using the include kwarg for those resources that support it, this way you won't get any lazy loading.

If I'm missing something and you could provide an example where prefetch_related would be beneficial than the current approach, I would really love to see it as that would help a lot.

Thanks.

maxtepkeev avatar Jan 07 '23 12:01 maxtepkeev

Closing this due to inactivity.

maxtepkeev avatar Mar 02 '24 18:03 maxtepkeev