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 contract search filters #68

Closed
wants to merge 7 commits into from
Closed

Added contract search filters #68

wants to merge 7 commits into from

Conversation

froi
Copy link
Member

@froi froi commented Aug 19, 2019

Note: Before submitting this pull request, please review our contributing guidelines.

Description

I've added some additional search filters to the contracts search.

  • Entity id
  • Entity source_id

This PR closes #45

- Added filtering by entity_id
- Added filtering by entity source_id
@froi froi requested a review from jpadilla August 19, 2019 12:57
@froi froi self-assigned this Aug 19, 2019
@froi
Copy link
Member Author

froi commented Aug 19, 2019

@jpadilla Estoy teniendo problemas con el filtro por source_id. Cuando eso este listo haré el full PR.

https://github.com/TheIndexingProject/contratospr-api/blob/5b118f31f0d6b17944dde2e79f4035639f307e1d/contratospr/contracts/search.py#L44

@jpadilla
Copy link
Contributor

@froi we're actually not using this method anymore after implementing filtering/search in the API. Should be safe to remove.

https://github.com/TheIndexingProject/contratospr-api/blob/a9573becade8c5097b7875257b55939ad76a3aa1/contratospr/api/filters.py#L18

https://github.com/TheIndexingProject/contratospr-api/blob/a9573becade8c5097b7875257b55939ad76a3aa1/contratospr/api/filters.py#L49

@froi
Copy link
Member Author

froi commented Aug 22, 2019

@jpadilla Yep, I noticed that a bit too late. I'm still working on this. I'm trying to get the API to filter by source_id for the Entity endpoints.

I'm getting the following error when using a ModelMultipleChoiceFilter on the source_id field

image

The filtering works well when using a NumericFilter and just one value.

@@ -167,10 +167,15 @@ class EntityFilter(django_filters.FilterSet):
queryset=Contractor.objects.all(),
method="filter_contractors_by_id",
)
# source_id = django_filters.NumberFilter()
source_id = django_filters.ModelMultipleChoiceFilter(
Copy link
Contributor

Choose a reason for hiding this comment

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

@froi no creo que podemos hacer esto aqui. Este filter espera un arreglo de entity ids no de source ids. Maybe podemos usar un TypedMultipleChoiceFilter while keeping the filter_entities_source_id method.

@froi
Copy link
Member Author

froi commented Feb 18, 2020

Creo que este PR ya no es relevante, oh mas bien esta muy separado del master branch. Closing for now.

@froi froi closed this Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Añadir busqueda de Entidad
2 participants