Firstly, thanks for this wonderful piece of software :)
I have a short question. Method queryset_to_list from the serialize.py module,
def queryset_to_list(queryset, **options):
...
return [model_to_dict(x, **options) for x in queryset.iterator()]
evaluates the queryset using an iterator. Doing so, has the downside that a queryset that has been evaluated already (on application level, for example), will be re-evaluated here. My main problem with this, is that any ad-hoc data attached to the model instances that were previously loaded when the queryset was first evaluated, are lost.
Contrary to that, if the queryset is evaluated normally without an iterator,
def queryset_to_list(queryset, **options):
...
return [model_to_dict(x, **options) for x in queryset]
it won't be re-evaluated again, if it has already been evaluated on application level, and therefore the implication I mentioned above is eliminated.
Hi,
Firstly, thanks for this wonderful piece of software :) I have a short question. Method
queryset_to_list
from theserialize.py
module,evaluates the queryset using an iterator. Doing so, has the downside that a queryset that has been evaluated already (on application level, for example), will be re-evaluated here. My main problem with this, is that any ad-hoc data attached to the model instances that were previously loaded when the queryset was first evaluated, are lost.
Contrary to that, if the queryset is evaluated normally without an iterator,
it won't be re-evaluated again, if it has already been evaluated on application level, and therefore the implication I mentioned above is eliminated.
I'm curious on your thoughts,