LimitOffsetParams don't work
See original GitHub issueThis way pagination works fine:
from fastapi_pagination import pagination_params
When switching to limit-offset version:
from fastapi_pagination.limit_offset import pagination_params
same code and adjusted request fail with: "Page should be used with PaginationParams"
Request:
http://0.0.0.0:8080/api/v1/call_records?date_from=2021-01-01&date_till=2021-02-01&limit=50&offset=0
Endpoint:
@router.get('/call_records', response_model=Page[CallRecord], dependencies=[Depends(pagination_params)], tags=['calls'])
@handle_exceptions
async def get_call_records(date_from: datetime.date, date_till: datetime.date):
records = await core.get_call_records(database, date_from, date_till, None)
page = paginate(records)
return page
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (14 by maintainers)
Top Results From Across the Web
bootstraptable not working well with knockoutjs - Stack Overflow
I am working on a page with knockout.js and bootstraptable,I don't know why the table did not render.Need help! Here is my sample...
Read more >diesel-rs/diesel - Gitter
I have a postgresql database with a users table involving a username and password_hash. I want to do authentication with pgcrypto, something like...
Read more >What's everyone working on this week (22/2017)? : r/rust - Reddit
I'm swamped with $work, so I probably won't get anything done apart from TWiR stuff. ... e.g. QueryParamGroup<(LimitOffsetParam, RouteSpecificParams)> .
Read more >Transformers - Fractal (PHP)
Fractal provides a presentation and transformation layer for complex data output, the like found in AJAX and RESTful APIs.
Read more >WordPress Pagination Not Working? Quick Fix - YouTube
Is the WordPress pagination not working on your website? This usually happens when you use the custom permalink structure ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, upon further testing it seems that the exporting keeps failing when Uvicorn reloads. Sometimes, it exports to OpenAPI schema correctly and is shown on the docs, but most of the time only a few routes are exported. Despite not being exported to the schema, the route still works as expected.
Will report back with code that can reproduce the error.
With new implementation, every
Page
class hasParams
type associated with it. Basically,Page
class has__params_type__
attribute wich is pointing toParams
class.For instance, how to create change default
Params
: