no standard for this , but thinking out loud with you .. you can make a many to many model ( table ) of 3 columns , first column will be user id , second column will be object id , third column will be number of visits ( integer initial value 0 ) , every time the object view is called you'll query the table for object.id if not found ( for first time , create a new row with this object.id and request.user.id and put number_of_visits column = 1 ) , if found then filter by user.id , if found increase number in number_of_visits column by one , if filter not returning thing then create a new row with object.id and user.id and put number_of_visits column = 1
On Wed, Apr 15, 2020 at 2:29 PM shreehari Vaasistha L < shreehari9...@gmail.com> wrote: > Thank you! > But can there be any simple implementation as i just want to count number > of times a user has viewed a post > > On Wednesday, April 15, 2020 at 5:48:36 PM UTC+5:30, Tim Wilson wrote: >> >> I'm planning to use django-hitcount too, but please be aware that it's >> not yet compatible with Django 3.x. There's a patch that needs to be >> applied and a release forthcoming that should take care of it. >> >> -Tim >> >> On Wed, Apr 15, 2020, at 4:38 AM, Omkar Parab wrote: >> >> Django hit count package will help you.. >> >> On Wed, Apr 15, 2020, 1:09 PM shreehari Vaasistha L <shreeh...@gmail.com> >> wrote: >> >> how can i get the number of views of an endpoint by a single user. >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/b9e434ba-8378-45cb-a67f-b344773340b6%40googlegroups.com >> <https://groups.google.com/d/msgid/django-users/b9e434ba-8378-45cb-a67f-b344773340b6%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/CAJY8mfxe%3Dgx4YnJj_%2BWLuVD-iTaeNy0BhMR4U1_bAXa93ObAMg%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAJY8mfxe%3Dgx4YnJj_%2BWLuVD-iTaeNy0BhMR4U1_bAXa93ObAMg%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> >> -- >> Tim Wilson >> President, Savvy Technology Group >> phone: 612-599-5470 >> >> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/36fd6a9b-e959-49ee-9183-f18c26daf1c9%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/36fd6a9b-e959-49ee-9183-f18c26daf1c9%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHV4E-c6AkWw%2Bk1jkVioQBYgAMxNaTTUECbezWWiz3iKQrYFYw%40mail.gmail.com.