Architectural question - decoupling modules but keeping some interaction

31 views
Skip to first unread message

Roodie

unread,
Jan 7, 2013, 10:44:05 AM1/7/13
to django...@googlegroups.com
Hello, what I am looking for is some pointers/articles about a fully modularized architecture, where some of the functionality could depend on an existence of a model in a given project. We are (re)building one of our portal applications, and I would like to fully modularize it.

Just a little example. Let's assume that the portal engine has an 'article' module, and a 'gallery' module. If a specific installation has the privileges for both modules (there are feauture switch apps for this part fortunately) then the editors can attach galleries to the articles in the admin. Same with the 'downloads' module, utilizing it they can attach files to the articles. So far so good, a simple model with some generic relations could solve the problem. 

But then we add a new module/content type, let's call it 'events'. Both the galleries and files should be attachable to this new content type also.

That's the goal I would like to achieve - decouple the modules, but keep the possibility of interaction between them. Are there any open source projects using a similar architecture to look at? Or any articles, examples, I would be grateful for any pointers really, because right now I am stuck here. The only idea I have so far is to create an abstract base class from which all the content types would be extended, and use some custom managers (to check if a given feature is enabled or not) to implement the feature, but I am not 100% convinced it is the right path. Any ideas or advice?

Thank you.   


Amirouche

unread,
Jan 7, 2013, 12:12:04 PM1/7/13
to django...@googlegroups.com
Héllo Roodie,
What you are looking for is an admin application that pulls the actions available on a particular model for a particular user based on the presence of another model and a set of permissions. Is it correct? Then the front is also some how dynamic it must have a way to pull all the «content» dependencies and render them.

The front you can use something similar to this.

For the backend, the admin can do that, you will need to tweak a bit the admin so that it renders the correct form (or formset) depending on the user permissions.  

If this is correct, I don't know any app or framework that does what you are looking for in generic way except the admin with tweaking, but it could be fun to do ;)

Regards,

Amirouche

nkryptic

unread,
Jan 7, 2013, 1:08:07 PM1/7/13
to django...@googlegroups.com
Based on what you're describing, I'd recommend you look through the code for django-cms.  While it doesn't do exactly what you describe, they are using a "plugin" system which might give you some ideas.
Reply all
Reply to author
Forward
0 new messages