I'm trying to design a pub/sub event system for my site. The inputs
will be Django signals (e.g. User logged in), views and external POST
requests. I can easily create subscriptions:

Event type, e.g. Auth.login
Instance, e.g. User object for Fred
Data, nothing for this example
User, subscribing user, I.e. me

I could use this to know when a particular user logs in. I can use the
Django user logged I signal to do:

Publish(event="auth.login", instance=user)

However, what if I wanted this silly subscription:

Subscribe(event="auth.login", filter={ "field": "age", "operator":
">", "value": 20})

The problem is that the filter applies to an instance not a query set
as this is evaluated in the publish function.

Infinitely more flexible yet infinitely more complex! I want to store
subscriptions in one table and they have to flexible enough to be
usable for any type of data.

Has anyone tried something like this in Django before? This must be
the craziest feature I've tried to implement!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to