D
D
Dev_nab2019-02-06 15:32:30
Django
Dev_nab, 2019-02-06 15:32:30

Django - How to display a list of users who read a given news item?

There is news of the site, as on the page of a separate news, display a list of users who are reading it now. those. in the last 10 minutes?
There is an idea, roughly speaking, to create a class N, where there will be 3 fields:
- User
- View date
- News ID
And on the news page, simply display a list of users with the news ID filter and view date for the last 10 minutes.
But it looks clumsy, how can it be implemented more elegantly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Shatalov, 2019-02-06
@netpastor

As an option, use a radish-type cache, setting the desired record lifetime

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question