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

Replace ingredient search function #1724

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rolandgeider
Copy link
Member

@rolandgeider rolandgeider commented Jul 12, 2024

This now uses the existing filter mechanisms from django-filter.

Usage:

api/v2/ingredient/search?term=foo becomes api/v2/ingredient[info]/?name__search=foo&language__codes=en

Other changes:

  • The old search filtered the results by language by default and used the special syntax &language=* to disable this filter. Now this behaviour can be controlled by passing the appropriate language parameter or not.
  • The results are now paginated. Instead of having a fixed number of entries, more can be retrieved if needed. Also the page size can be specified like in the other endpoints with &limit=xyz
  • All other filters can now be applied as well, such as &source_name=USDA

Using the existing filter mechanisms from django-filter
@rolandgeider rolandgeider force-pushed the feature/ingredient-search branch from e138bee to 6887068 Compare July 12, 2024 13:01
rolandgeider added a commit to wger-project/react that referenced this pull request Jul 12, 2024
Note that this is a workaround, ideally we would properly support the new results
and not just convert them.

See wger-project/wger#1724
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.

1 participant