You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Models related by a Fk to another model are failing to fetch records on the first run. For example where a 'student' has a FK to a 'class', the class is being fetched first but then none of the 'student' records are fetched. Debugging shows that even when we have just fetched all 'class' records, when we process the strategy for the 'student' model and we run 'get_exported_pks_for_model' for the 'class' related model, no primary keys are returned and so the 'studend' queryset returned by get_queryset contains no records.
Removing the '@functools.lru_cache' decorator from 'get_exported_pks_for_model' and 'get_exported_objects_for_model 'fixes the issue.
The text was updated successfully, but these errors were encountered:
Sorry for the late reply, I have only just seen this! Could you possibly post the strategy setup you're using that I can try to reproduce with?
Removing the '@functools.lru_cache' decorator from 'get_exported_pks_for_model' and 'get_exported_objects_for_model 'fixes the issue.
Good find, but I seem to remember this was a fairly important optimisation so I'd rather not remove it if possible.
I was going to create a PR that fixes this issue but it looks like I dont have permissions to do this.
I'm sorry you're having trouble with this. I'm not sure why this would be, and I believe others have opened PRs without issue. Can you tell me what steps you've taken to try to open a PR? Where are you hitting the issue?
Models related by a Fk to another model are failing to fetch records on the first run. For example where a 'student' has a FK to a 'class', the class is being fetched first but then none of the 'student' records are fetched. Debugging shows that even when we have just fetched all 'class' records, when we process the strategy for the 'student' model and we run 'get_exported_pks_for_model' for the 'class' related model, no primary keys are returned and so the 'studend' queryset returned by get_queryset contains no records.
Removing the '@functools.lru_cache' decorator from 'get_exported_pks_for_model' and 'get_exported_objects_for_model 'fixes the issue.
The text was updated successfully, but these errors were encountered: