TIMEX
TIMEX

Reputation: 271824

In Django, how do I keep a running list of notifications for the user?

When the user clicks the "My Notifications" tab, I want him to see a list of new and old notifications and the time that the action happened. That means, the notifications must be stored, and must even have a cursor to be paged through.

Does the Django message framework do this?

Upvotes: 0

Views: 327

Answers (2)

lprsd
lprsd

Reputation: 87095

Yes, as Siddharth rightly mentioned, you can't use the builtin framework to do this, as this is a big deviation from what it is intended to do.

But, there is an app for that. django-notification app does precisely that!

Upvotes: 2

sidhshar
sidhshar

Reputation: 1061

Adjusting Django messages framework to fit with your requirement would be a big deviation from the way the framework works.

I would strongly recommend not to use the framework for this particular use-case since creating a simple Django model (User FK, Notification, created datetimestamp) would be a better approach.

Upvotes: 5

Related Questions