示例#1
0
    def follows(self, request, pk=None):
        profile = self.get_user(request, pk)

        page = get_int_or_404(request.query_params.get('page', 0))
        if page == 1:
            page = 0  # api allows explicit first page

        search = request.query_params.get('search')

        users = Follows(request, profile, page, search)

        return Response(users.get_frontend_context())
示例#2
0
    def follows(self, request, pk=None):
        profile = self.get_user(request, pk)

        page = get_int_or_404(request.query_params.get('page', 0))
        if page == 1:
            page = 0  # api allows explicit first page

        search = request.query_params.get('search')

        users = Follows(request, profile, page, search)

        return Response(users.get_frontend_context())
    def get_context_data(self, request, profile):
        users = Follows(request, profile)

        request.frontend_context['PROFILE_FOLLOWS'] = users.get_frontend_context()
        return users.get_template_context()
示例#4
0
    def get_context_data(self, request, profile):
        users = Follows(request, profile)

        request.frontend_context[
            'PROFILE_FOLLOWS'] = users.get_frontend_context()
        return users.get_template_context()