Skip to content

Pager does not allow pulling usage information for views.get() #444

Closed

Description

@shinchris

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.

Activity

  1. t8y8 commented on Jun 19, 2019

    @t8y8
    Contributor

    Actually, we do!

    Sorta.

    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.

  2. t8y8 commented on Jun 26, 2019

    @t8y8
    Contributor

    Solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions