Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMSPlugin.get_plugin_instance performance consideration #1077

Closed
ojii opened this issue Oct 29, 2011 · 1 comment
Closed

CMSPlugin.get_plugin_instance performance consideration #1077

ojii opened this issue Oct 29, 2011 · 1 comment
Milestone

Comments

@ojii
Copy link
Contributor

ojii commented Oct 29, 2011

In order to allow developers to use custom managers on their plugin model classes to auto-select_related related models, get_plugin_instance should probably use plugin_class.model.objects.get(cmsplugin_ptr=self), since the current implementation uses plugin_class._base_manager (see django.db.models.fields.related.SingleRelatedObjectDescriptor.__get__) ignoring all custom managers. The only advantage of using the SingleRelatedObjectDescriptor to access the plugin instance here is that this descriptor caches the object. This could be implemented easily in our code though.

EDIT: possibly also mention in the docs how you can auto-select_related stuff

@digi604 digi604 added this to the Some Day milestone Feb 10, 2014
@FinalAngel
Copy link
Member

@ojii is this still relevant or might it be closed?

@FinalAngel FinalAngel modified the milestones: Clean up issues & pull request, Some day Oct 19, 2015
@evildmp evildmp closed this as completed May 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants