Open josejachuf opened 7 months ago
I think if you can build a view easily, mapping a model with it is the easiest and most performance way to do this.
The other approach as you correctly guessed is to handle the querying manually; I'd personally make a subclass of JSONQueryPipe
(https://github.com/emmett-framework/rest/blob/v1.5.2/emmett_rest/queries/helpers.py#L25) which implements a custom parser (https://github.com/emmett-framework/rest/blob/v1.5.2/emmett_rest/queries/parser.py#L157) that parse the specific keys adding the join queries. But given the current implementation, this is far from being simple to implement. I might consider refactoring the parser to better support custom parsers out of the box in the future.
I have the following:
My Endpoint uses model B. What would be the simplest way to use the where feature, if you can consult by:
a1 c1
He had thought about creating a view and then a model mapping with view. Any better option?
The other thing that occurs to me would be to use this and do everything manually: