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

wiki.models cannot be loaded from a plugin view module #23

Closed
benjaoming opened this issue Aug 20, 2012 · 2 comments
Closed

wiki.models cannot be loaded from a plugin view module #23

benjaoming opened this issue Aug 20, 2012 · 2 comments
Labels
bug Confirmed bug

Comments

@benjaoming
Copy link
Member

Steps to reproduce:

  1. Create a plugin with a wiki_plugin.py and an urlpattern in the BasePlugin.
  2. Point to a view that has "from wiki import models"

It won't work because of circularity.

@benjaoming
Copy link
Member Author

Still very annoying for plugins.

  • it has nothing to do with the order of settings.INSTALLED_APPS

@benjaoming
Copy link
Member Author

The problem seems to be that views should not be imported in wiki_plugin.py files.

This would have been easier to discover without the magic of the plugin loader, and a more flat-out registration performed directly in a plugin's model module.

Suggesting to refactor BasePlugin to not include article_view but rather use some url naming convention and lazy url reversals. As long as the urlpatterns need to actively call something inside the plugin's view module, there will be circularity as BasePlugin is loaded from either wiki.models or the plugin.models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

1 participant