Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Use prefetch related to trigger polymorphic downcast. #116

Merged
merged 1 commit into from Feb 12, 2014

Conversation

Projects
None yet
2 participants
Collaborator

yakky commented Feb 11, 2014

Under some circumstances, the filer File object is not correctly casted to the relevant child class.
Using prefetch_related triggers the casting more reliably.
This may cause a little performance hit, but the whole file attribute (the only 'real' case in cmsplugin-filer for this code to be executed) is going to be retrieved anyway in nearly all cases so this is not going to be much relevant

Collaborator

yakky commented Feb 11, 2014

@stefanfoulis this is needed to solve the long standing stefanfoulis/django-filer#255 which currently I am working on

@stefanfoulis stefanfoulis added a commit that referenced this pull request Feb 12, 2014

@stefanfoulis stefanfoulis Merge pull request #116 from nephila/feature/prefetch
Use prefetch related to trigger polymorphic downcast.
51364da

@stefanfoulis stefanfoulis merged commit 51364da into divio:develop Feb 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment