Re: [sqlalchemy] Building relatively complex dynamic queries in SQLAlchemy

2018-01-03 Thread Jonathan Vanasco
I have a few of these and generally use a variant of Simon's method where I wrap everything in a custom class. I stash all the requirements/options in the custom class instance, then invoke a `count()` or `paginated()` method that builds/stashes the core query and runs `count()` or `all()` on

Re: [sqlalchemy] Building relatively complex dynamic queries in SQLAlchemy

2018-01-03 Thread Simon King
On Tue, Jan 2, 2018 at 11:59 PM, Nikola Jankovic wrote: > I have an API endpoint that handles searches from the frontend. A search can > have a dynamic amount of filters applied to it, including (1) sizes, (2) > colors, (3) price, and (4) category that are passed through query

[sqlalchemy] Building relatively complex dynamic queries in SQLAlchemy

2018-01-02 Thread Nikola Jankovic
I have an API endpoint that handles searches from the frontend. A search can have a dynamic amount of filters applied to it, including (1) sizes, (2) colors, (3) price, and (4) category that are passed through query parameters. Sizes and colors are passed as comma separated values (i.e.