예제 #1
0
    def posts(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

        feed = UserPosts(request, profile, page)

        return Response(feed.get_frontend_context())
예제 #2
0
    def posts(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

        feed = UserPosts(request, profile, page)

        return Response(feed.get_frontend_context())
예제 #3
0
def posts(request, profile):
    context = {
        'profile': profile,
    }

    feed = UserPosts(request, profile)
    context.update(feed.get_template_context())

    request.frontend_context['POSTS'] = feed.get_frontend_context()

    return render(request, 'misago/profile/posts.html', context)
예제 #4
0
    def get_context_data(self, request, profile):
        feed = UserPosts(request, profile)

        request.frontend_context['POSTS'] = feed.get_frontend_context()
        return feed.get_template_context()
예제 #5
0
파일: profile.py 프로젝트: tommy-56/Misago
    def get_context_data(self, request, profile):
        feed = UserPosts(request, profile)

        request.frontend_context['POSTS'] = feed.get_frontend_context()
        return feed.get_template_context()