Skip to content

Add CS PackageRating rate form and view #1079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Add CS PackageRating rate form and view #1079

merged 2 commits into from
Dec 4, 2024

Conversation

MythicManiac
Copy link
Member

This PR supersedes #1023 with the following changes:

  • Remove form usage entirely as it was complicating things for no
    benefit
  • Create a classmethod in the PackageRating model for performing the
    rating action (and validation of it)
  • Update the v1 rating API view to use the new classmethod for
    performing the action
  • Move experimental API package rating list to it's own dedicated
    endpoint to avoid slowing down the main current-user endpoint if there
    are lots of ratings
  • Cap the rated package count returned by the experimental API to
    improve performance for users with hundreds of rated packages. This
    should be updated to a paginated + local cache solution later on, good
    enough for now.

- Remove form usage entirely as it was complicating things for no
  benefit
- Create a classmethod in the PackageRating model for performing the
  rating action (and validation of it)
- Update the v1 rating API view to use the new classmethod for
  performing the action
- Move experimental API package rating list to it's own dedicated
  endpoint to avoid slowing down the main current-user endpoint if there
  are lots of ratings
- Cap the rated package count returned by the experimental API to
  improve performance for users with hundreds of rated packages. This
  should be updated to a paginated + local cache solution later on, good
  enough for now.
@MythicManiac MythicManiac merged commit e291169 into master Dec 4, 2024
24 checks passed
@MythicManiac MythicManiac deleted the cs-pkg-rate-2 branch December 4, 2024 11:39
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