You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pager does not allow pulling usage information for views.get() #444
The Pager generator takes in RequestOptions, but usage information for views.get() requires another parameter to be passed in. Currently, we cannot use Pager to get all views WITH usage information.
Pager accepts any callable, so you can just pass in a partial.
from functools import partial
usage_pager = partial(server.views.get, usage=True)
views = TSC.Pager(usage_pager)
for view in views:
# do something
It could probably be a little cleaner but not sure how yet. We could have Pager take in *args and just blindly pass them to the callable, which works. Or we can document you should use a partial.
Reacted by Ivan Pushin and David Sanchez-Crujeiras
Activity
t8y8 commentedon Jun 19, 2019
Actually, we do!
Sorta.
Pager accepts any callable, so you can just pass in a partial.
It could probably be a little cleaner but not sure how yet. We could have
Pagertake in *args and just blindly pass them to the callable, which works. Or we can document you should use a partial.t8y8 commentedon Jun 26, 2019
Solved!