Skip to content

Отдельная ручка для списков проектов на которые подписан пользователь#242

Merged
yakser merged 3 commits intodevfrom
feature/subscribed-projects-list
Nov 22, 2023
Merged

Отдельная ручка для списков проектов на которые подписан пользователь#242
yakser merged 3 commits intodevfrom
feature/subscribed-projects-list

Conversation

@yakser
Copy link
Member

@yakser yakser commented Nov 22, 2023

Отдельная ручка для списков проектов на которые подписан пользователь

@yakser yakser requested a review from VeryBigSad November 22, 2023 17:12
Create pagination class in core app
Copy link
Contributor

@VeryBigSad VeryBigSad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

все идеально, ток поправь class UserSubscribedProjectsList

Comment on lines +386 to +393
user = User.objects.get(pk=self.kwargs["pk"])
page = self.paginate_queryset(user.subscribed_projects.all())
if page is not None:
serializer = self.get_serializer(page, many=True)
return self.get_paginated_response(serializer.data)
raise exceptions.ValidationError("Unable to return paginated list")
except User.DoesNotExist:
raise exceptions.NotFound
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это должно автоматом пагинироваться, нет? Достаточно просто pagination_class добавить

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

с кастомным get по моему нет

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хотя щас попробую натворить кое что

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправил

@yakser yakser merged commit 3db9129 into dev Nov 22, 2023
@sh1nkey sh1nkey deleted the feature/subscribed-projects-list branch March 18, 2024 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants