Ask Your Question
0

Can I write a event-driven plugin for askbot?

asked 2013-02-02 14:01:51 -0600

threebean gravatar image

I'm starting to look into how to get events out of an askbot installation. When a user posts a new question, or gets their question answered, or wins a badge.. (or anything else) ..I want to publish zeromq messages.

Thinking about it (and admittedly not having read much askbot or django code yet) leads me to believe writing some kind of event-based plugin would be the most straightforward. Alternatively, I could patch my hooks right into askbot's code base itself.. but that is not very easily maintainable. As askbot develops, I'll have to change my patches to keep pace (a pain!)

What methods for plugging-in exist? Could I write a layer of django middleware? Could I make a model extension that emits events when attributes on certain models change in certain ways?

Does anybody have any advice on which approaches to look into?

edit retag flag offensive close merge delete

Comments

Just a note: django signals looks like a pretty good mechanism for this: https://docs.djangoproject.com/en/dev/topics/signals/

threebean gravatar imagethreebean ( 2013-02-02 14:28:10 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-02-02 14:40:14 -0600

Evgeny gravatar image

We have some signals defined in askbot/models/signals.py and we can add new. We should probably adjust names of those signals and document them. We did not give much thought to naming them properly.

edit flag offensive delete link more

Comments

This worked very well. Here is my plugin: https://github.com/fedora-infra/askbot-fedmsg

threebean gravatar imagethreebean ( 2013-02-02 22:26:39 -0600 )edit

Feel free to develop and change those signals, btw. I don't mind updating my code to keep pace. Cheers and thanks again!

threebean gravatar imagethreebean ( 2013-02-03 18:31:20 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-02-02 14:01:51 -0600

Seen: 124 times

Last updated: Feb 02 '13