Henrik Lied escribió:
> When you say "installs", do you mean that the plugin is retrieved from
> the external site, and placed somewhere on the users host, or is it
> constantly querying the plugin on a remote computer?
> 
> The first of those two options would definitely be the best. But I'm
> having some problems working it out IRL:
> Let's say you've just installed the Akismet-plugin. How are we
> supposed to notify the comment framework that a new plugin has been
> installed - and better yet - how it should use it? This is a valid
> problem for almost every plugin. If we manage to resolve a good answer
> to that question, I'm done being a critic. :-)
> 

The first version should do ;)

As for your question about "letting the comment app know", it would be a
nice idea to keep looking at django for answers. Does this situations
sound familiar?

I was thinking of middleware. You might "register" a plugin to work
agains some app (or apps) and therefor, make the app(s) call certain
methods within the plugin. The plugin would only have to implement those
methods.

If we do the "registering" stuff at database level, it would be a snap
to automate the installation.

Only, the apps need to know that they must call something. Definately,
the current django apps (like comments) do not behave that way, and
hacking them is not the answer.

What about a plugin middleware? It could check incoming requests for
certain data in the request (perhaps a post key?) and do something
accordingly.

If there's a way to make this approach work with a single middleware
(BlogPluginMiddleware?) this would be a pretty nice beginning :-)

Chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to