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

CM-71: added support for applying queryset based on custom filters provided by frontend #10

Merged
merged 8 commits into from Jun 15, 2023

Conversation

sniedzielski
Copy link
Contributor

@sniedzielski sniedzielski commented Jun 7, 2023

part of ticket: https://openimis.atlassian.net/browse/CM-71

  • added additional implementation of interface for applying custom filters provided by frontend into Django queryset
  • additional methods to clean input for filters and for casting from string (frontend provides data for filters values as strings)

@sniedzielski sniedzielski changed the base branch from develop to main June 7, 2023 16:34
@sniedzielski sniedzielski changed the base branch from main to develop June 7, 2023 16:34
@sniedzielski sniedzielski changed the title Feature/cm 71 CM-71: added support for applying queryset based on custom filters provided by frontend Jun 14, 2023
@sniedzielski sniedzielski marked this pull request as ready for review June 14, 2023 07:24
Copy link
Contributor

@dborowiecki dborowiecki left a comment

Choose a reason for hiding this comment

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

Looks solid, I've made some comments regarding documentation.

"""
Apply custom filters to a queryset.

:param custom_filters: List of named tuples representing custom filters.
Copy link
Contributor

Choose a reason for hiding this comment

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

This information is already provided through in typehint, it's better to give some example of how this named tuple looks like.

Apply custom filters to a queryset.

:param custom_filters: List of named tuples representing custom filters.
:type custom_filters: List[namedtuple]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this also is redundant, we have information about type in the hint.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same for queryset

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

:param custom_filters: List of named tuples representing custom filters.
:type custom_filters: List[namedtuple]

:param query: The original queryset with filters.
Copy link
Contributor

Choose a reason for hiding this comment

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

Any specific type of QuerySet is required? Like Queryset[BenefitPlan] ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, sth like this. Mostly related to Queryset[Beneficiary] in that case.

@sniedzielski
Copy link
Contributor Author

@dborowiecki docsstring fixed

@dborowiecki dborowiecki merged commit 8d7c82c into develop Jun 15, 2023
2 checks passed
@dborowiecki dborowiecki deleted the feature/CM-71 branch June 15, 2023 09:20
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.

None yet

2 participants