Skip to content

Conversation

@cript0nauta
Copy link

Hi! I'm thinking in using this library to refactor an existing RESTful API. I need to be able to override the default_operator attribute of some fields but not of all of them, but I noted that is not possible yet (the column_overrides doesn't use this). I wrote a simple fix for this issue.

With this change I could do something like this:

class AlbumFilterSet(FilterSet):
    class Meta:
        model = Album
        query = session.query(Album)
        operators = (Equal, Greater, Less)
        column_overrides = {
            'name': {'default_operator': Like}
        }

So I can do something like this:
```python
class AlbumFilterSet(FilterSet):
    class Meta:
        model = Album
        query = session.query(Album)
        operators = (Equal, Greater, Less)
        column_overrides = {
            'name': {'default_operator': Like}
        }
```
@llazzaro
Copy link

llazzaro commented Feb 5, 2018

@jmcarp Any news on this fix? I also hit the same bug.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants