Skip to content

Feat/filter in request #266

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 33 commits into from
Mar 11, 2024
Merged

Feat/filter in request #266

merged 33 commits into from
Mar 11, 2024

Conversation

AMontagu
Copy link
Collaborator

@AMontagu AMontagu commented Feb 14, 2024

Before merging need:

  • Add settings to control behavior with default to old behavior
  • Add also pagination possibility to keep logic behavior
  • Add documentation on filtering
  • Add documention on new settings
  • Add documentation disclaimer that default behavior will change in 1.0.0 to be accepting only filters from request by default
  • update filter and pagination documentation with last plugin system
  • Add documentation on Plugin
  • Add documentation on MessageNameConstructor
  • NOT A GOOD IDEA AFTERTHOUGHT - NOT DONE Create a plugin that inherit from requestlist, filter and pagination plugins to use in in List and Stream mixins
  • Replace all depecrated arguments in fakeApp by plugin

@AMontagu AMontagu requested a review from legau February 14, 2024 09:56
@AMontagu AMontagu force-pushed the feat/filterInRequest branch from 04197f2 to 2248f0d Compare February 15, 2024 10:43
Copy link
Contributor

@legau legau left a comment

Choose a reason for hiding this comment

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

For the added fields in grpc actions I would suggest going the other way around and delegating this to the genericservices themselves to have more flexibility

something like :

class Service:
    def _extra_action_fields(self) -> list[ProtoField]: 
        return []

class GenericService(Service):
    filterset_class = MyFilterSet
    pagination_class = MyPagination

    @classmethod
    def _additional_action_fields(self):
        ...
        filter_field = ProtoField(...)
        pagination_field = ProtoField(...)
        ...
        return [*super()._extra_action_fields(), filter_field, pagination_field]
    
class GrpcAction:
    def make_proto_rpc(..., service):
        self.create_proto_message(..., additional_fields=service._additional_action_fields())
    
class ProtoMessage:
    def create(..., additional_fields: list[ProtoField]):
        ...

Adapt filter doc for plugin system
Adapt pagination doc for plugin system
Add generation plugin doc
Add MessageNameConstructor doc
Add DEFAULT_MESSAGE_NAME_CONSTRUCTOR and DEFAULT_GENERATION_PLUGINS and their doc
@AMontagu AMontagu force-pushed the feat/filterInRequest branch from d1c61ef to fae180e Compare February 23, 2024 13:20
@AMontagu AMontagu force-pushed the feat/filterInRequest branch from 4cc9fb3 to 405d8f8 Compare March 11, 2024 13:40
Update docs/features/grpc-action.rst

Co-authored-by: Léni <[email protected]>
Update docs/features/grpc-action.rst

Co-authored-by: Léni <[email protected]>
Update docs/features/grpc-action.rst

Co-authored-by: Léni <[email protected]>
Update docs/features/pagination.rst

Co-authored-by: Léni <[email protected]>
Update docs/features/pagination.rst

Co-authored-by: Léni <[email protected]>
Update docs/features/pagination.rst

Co-authored-by: Léni <[email protected]>
Update docs/features/filters.rst

Co-authored-by: Léni <[email protected]>
Update docs/settings.rst

Co-authored-by: Léni <[email protected]>
Update docs/settings.rst

Co-authored-by: Léni <[email protected]>
Update docs/settings.rst

Co-authored-by: Léni <[email protected]>
Update docs/settings.rst

Co-authored-by: Léni <[email protected]>
Follow review and class names

Update docs/features/proto-generation.rst

Co-authored-by: Léni <[email protected]>
adapt test to class renaming
@AMontagu AMontagu force-pushed the feat/filterInRequest branch from 405d8f8 to 7c0c48a Compare March 11, 2024 17:01
@AMontagu AMontagu merged commit 47e146c into master Mar 11, 2024
4 checks passed
@AMontagu AMontagu deleted the feat/filterInRequest branch March 11, 2024 17:09
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