# Path: src/moviesapp/views/mixins.py
# class TemplateAnonymousView(TemplateViewOriginal):
#     pass
# 
# class TemplateView(LoginRequiredMixin, TemplateViewOriginal):
#     pass
# 
# Path: src/moviesapp/views/utils.py
# def paginate(objects, page, objects_on_page):
#     paginator = Paginator(objects, objects_on_page)
#     try:
#         objects = paginator.page(page)
#     except PageNotAnInteger:
#         # If page is not an integer, deliver first page.
#         objects = paginator.page(1)
#     except EmptyPage:
#         # If page is out of range (e.g. 9999), deliver last page of results.
#         objects = paginator.page(paginator.num_pages)
#     return objects


from datetime import datetime
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from moviesapp.models import ActionRecord
from .mixins import TemplateAnonymousView, TemplateView
from .utils import paginate
        }

        date_to = datetime.today()
        date_from = date_to - relativedelta(days=settings.FEED_DAYS)
        actions = ActionRecord.objects.filter(date__range=(date_from, date_to)).order_by("-pk")

        users = self.request.user.get_users(friends=list_name == "friends")
        actions = actions.filter(user__in=users)
        posters = [action.movie.poster_small for action in actions]
        posters_2x = [action.movie.poster_normal for action in actions]
        actions_output = []

        i = 0
        for action in actions:
            action_ = {
                "user": action.user,
                "action": action,
                "movie": action.movie,
                "movie_poster": posters[i],
                "movie_poster_2x": posters_2x[i],
                "list": action.list,
                "comment": action.comment,
                "rating": action.rating,
                "date": action.date,
            }
            actions_output.append(action_)
            i += 1
        return {"list_name": FEED_TITLE[list_name], "actions": actions_output}



# Path: src/moviesapp/views/mixins.py
# class TemplateAnonymousView(TemplateViewOriginal):
#     pass
# 
# class TemplateView(LoginRequiredMixin, TemplateViewOriginal):
#     pass
# 
# Path: src/moviesapp/views/utils.py
# def paginate(objects, page, objects_on_page):
#     paginator = Paginator(objects, objects_on_page)
#     try:
#         objects = paginator.page(page)
#     except PageNotAnInteger:
#         # If page is not an integer, deliver first page.
#         objects = paginator.page(1)
#     except EmptyPage:
#         # If page is out of range (e.g. 9999), deliver last page of results.
#         objects = paginator.page(paginator.num_pages)
#     return objects


# Path: src/moviesapp/views/social.py
from datetime import datetime
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from moviesapp.models import ActionRecord
from .mixins import TemplateAnonymousView, TemplateView
from .utils import paginate

        }

        date_to = datetime.today()
        date_from = date_to - relativedelta(days=settings.FEED_DAYS)
        actions = ActionRecord.objects.filter(date__range=(date_from, date_to)).order_by("-pk")

        users = self.request.user.get_users(friends=list_name == "friends")
        actions = actions.filter(user__in=users)
        posters = [action.movie.poster_small for action in actions]
        posters_2x = [action.movie.poster_normal for action in actions]
        actions_output = []

        i = 0
        for action in actions:
            action_ = {
                "user": action.user,
                "action": action,
                "movie": action.movie,
                "movie_poster": posters[i],
                "movie_poster_2x": posters_2x[i],
                "list": action.list,
                "comment": action.comment,
                "rating": action.rating,
                "date": action.date,
            }
            actions_output.append(action_)
            i += 1
        return {"list_name": FEED_TITLE[list_name], "actions": actions_output}



class PeopleView(TemplateAnonymousView):