views:

71

answers:

1

I want to show various messages to registered users only once in my django application. I found django-announcements which seemed to do what I want - but I found in testing it marks messages as read by using a session variable, which disappears if the user logs out. This means a message is shown again to a user if they dismiss it when logged in, log out, and then log in again.

I wondered if anyone know of an application that I might be able to use here without re-inventing the wheel.

+3  A: 

Have a look at django-notification. It is used by pinax, there it seems to work like what you are searching for. At least it saves the status in the db.

edit

Response to the comment

from the docs:

notification.send([to_user], "friends_invite", {"from_user": from_user})

so this should work:

notification.send(Users.objects.all(), "friends_invite", {"from_user": from_user})

and if a queryset isnt right:

notification.send([u for u in Users.objects.all()], "friends_invite", {"from_user": from_user})
vikingosegundo
I'm using django-notification but it unfortunately didnt seem to handle notifications to _all_ users.
Tristan
the list comprehension in the last example could more easily and clearly be written as `list(Users.objects.all())` instead of `[u for u in Users.objects.all()]`.
jcdyer
what is more clearly and easily is matter of taste, I think. But your comment is a good hint.
vikingosegundo