Skip to content
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

Added Django filter for API endpoints #218

Merged
merged 12 commits into from
Mar 16, 2022
Merged

Conversation

KiOui
Copy link
Owner

@KiOui KiOui commented Mar 12, 2022

Added API query parameters to the following endpoints:

  • Associations list (searching on name is now possible)
  • Products list (filtering on several parameters is now possible, searching on name and barcode is now possible), the old ProductSearchAPIView endpoint has been deleted in favor of searching on the Products list endpoint. Javascript has also been fixed for the change in endpoint.
  • Shifts list (filtering on several parameters is now possible)
  • Orders list (filtering on several parameters is now possible)
  • Players list (filtering on venue is now possible, searching on display_name is now possible)
  • Venue list (filtering on can_be_reserved is now possible, searching on name and slug is now possible)
  • Reservation list (filtering on several parameters is now possible), the old VenueReservationListAPIView has been deleted in favor of the normal Reservation list view with a query parameter (e.g. filtering on venue). Also note that the days parameter for the Reservation list view has been deleted in favor of start__gte and start__lte. Javascript has also been fixed for the change.

In addition, the following bugs were fixed:

  • A bug where get_queryset of the ProductsListAPI was called when the schema was generated which raised a Warning.
  • A bug where the modal was not being closed after a product was scanned or added in the admin scanner view (due to the upgrade to Bootstrap 5).

Closes #180

@KiOui KiOui marked this pull request as draft March 12, 2022 09:27
@KiOui KiOui marked this pull request as ready for review March 13, 2022 10:18
@KiOui KiOui requested a review from JobDoesburg March 13, 2022 10:27
@KiOui KiOui self-assigned this Mar 13, 2022
let yearInThePast = now.getTime() - yearOffset;
let yearInTheFuture = now.getTime() + yearOffset;
let yearInThePastDate = new Date(yearInThePast);
let yearInTheFutureDate = new Date(yearInTheFuture);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would refactor these variable names

@KiOui KiOui merged commit c72fd1c into master Mar 16, 2022
@KiOui KiOui deleted the feature/add-django-filter branch March 16, 2022 12:48
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.

Use Django-filter
2 participants