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

save full plugin name instead of just class name #2562

Closed
digi604 opened this Issue Feb 3, 2014 · 3 comments

Comments

Projects
None yet
4 participants
Member

digi604 commented Feb 3, 2014

No description provided.

Member

digi604 commented Feb 4, 2014

We definitely need to remove all plugins first from core.

@digi604 digi604 modified the milestones: 3.X, 3.0 Feb 10, 2014

Owner

stefanfoulis commented Mar 19, 2015

The reason for this change is to avoid name clashes in different apps.

Currently it is not possible for multiple apps to register a plugin with the same class name. The idea is to prefix the plugin with a full class prefix of the module where the plugin resides.
Additionally it should be possible to override the value on the plugin class.

Some relevant code points:

Where the value is saved on the plugin model in https://github.com/divio/django-cms/blob/3.0.12/cms/models/pluginmodel.py#L77

It is extracted from the plugin here when it is registered to the pool: https://github.com/divio/django-cms/blob/3.0.12/cms/plugin_pool.py#L99

Here the value saved on the plugin model is used to fetch the plugin: https://github.com/divio/django-cms/blob/3.0.12/cms/plugin_pool.py#L254-260

The trickiest part will be coming up with a migration path. It's not nice to do it in a south migration, because it would require importing all the plugins in the migration. On the other hand we might be able to just read from the plugin_pool from the migration anyway... a bit "dirty" but would make it much easier. I suspect the plugin_pool is populated anyway when running migrations.

Owner

czpython commented May 25, 2016

Closing as duplicate of #462

@czpython czpython closed this May 25, 2016

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