cityofaustin / knackpy

A Python client for interacting with Knack applications
https://cityofaustin.github.io/knackpy/docs/user-guide/
Other
39 stars 17 forks source link

Filters require refresh=True #116

Open pjaol opened 11 months ago

pjaol commented 11 months ago

Part of #89

In order to query with a filter, the

app.get(object_view, filters=filter) 

requires explicitly passing refresh=True

What would help is if this line https://github.com/cityofaustin/knackpy/blob/cf236649f9347218b2f29e7babd2f531cb39fc6e/knackpy/app.py#L227 and https://github.com/cityofaustin/knackpy/blob/cf236649f9347218b2f29e7babd2f531cb39fc6e/knackpy/app.py#L232

also checked to see if filters was not None, or even easier would be to explicitly set refresh to True if filters are passed in


def get(
        self,
        identifier: str = None,
        refresh: bool = False,
        record_limit: int = None,
        filters: typing.Union[dict, list] = None,
        generate=False,
    ):
.....

if not refresh : 
    if not filters == None : 
        refresh = True

Happy to create a PR if you want one