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
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
The text was updated successfully, but these errors were encountered:
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 usesplugin_class._base_manager
(seedjango.db.models.fields.related.SingleRelatedObjectDescriptor.__get__
) ignoring all custom managers. The only advantage of using theSingleRelatedObjectDescriptor
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
The text was updated successfully, but these errors were encountered: