1. sirex
  2. django-plugins
  3. Issues
Issue #4 resolved


Anonymous created an issue

In my project I found useful to have a method that returns a plugin providing their name. This is the code that I use if you're interested on it.

{{{ くらめそ def get_plugin(cls, name): """ Returns the plugin based on their name, if exists


if is_plugin_point(cls):
    point_pythonpath = cls.get_pythonpath()
    return Plugin.objects.get(point__pythonpath=point_pythonpath,
    raise Exception(_('This method is only available to plugin point '


Comments (2)

  1. sirex repo owner

    Actually, this does almost exactly what you want:


    Method name is get_model to be not confused with get_plugin method name of plugin model instance.

    My example only lacks checking for plugin status, what I just fixed in e764253ff683.

    That you for this proposal.

  2. Anonymous

    Thank you very much sirex, I was thinking that get_model returns a Model instead of a Model instance. :) I'll use it!

  3. Log in to comment