For example like in eclipse having "extension points" where 3rd party
applications could hook into .. and extend the original
functionality ..
in specific i need this (e.g.) for a user profile view.. my project
consists of multiple applications and i want them all to be
independent .. and also have personal settings on their own..
so i would have a community application which is responsible for
registration & co .. and would also allow the user to change his
profile and edit settings.. but what if i want to make it easily
possible for my wiki and board applications to contribute additional
settings to this view ? is there any django specific way to do
something like it, or any thoughts on how i could implement a generic
interface for such a problem ?
i guess the signal API would be one possibility ? to simply send out
specific signals like 'render_profile' and 'post_profile' where
multiple application could listen to and respond accordingly ?
i don't expect that there is any ready-to-use solution out there, so i
would welcome any thoughts on that ;) ..
thanks,
herbert
http://sct.sphene.net - Sphene Community Tools
Hi
I've found the following [1] a good starting point for similar
functionality in some of my projects. Check out the file
<trac-dir>/trac/core.py.
[1] http://trac.edgewall.org/wiki/TracDev/ComponentArchitecture
cheers
Steven
You can do what you want using a combination of Python's class
introspection functions and Django's model index
(django.db.models.get_app(), get_model(), etc).
Define a setting that specifies the name of the class that provides
the UserProfile model, then when you need to reference the UserProfile
model, load it dynamically using __import__.
You can take a similar approach for any utility method supporting the
UserProfile - say, a factory for generating a UserProfile form. Define
an interface, put the name of the factory method in a setting, and
dynamically load the function as required.
Yours,
Russ Magee %-)