{"action":"opened","issue":{"url":"https://api.github.com/repos/viewflow/django-material/issues/335","repository_url":"https://api.github.com/repos/viewflow/django-material","labels_url":"https://api.github.com/repos/viewflow/django-material/issues/335/labels{/name}","comments_url":"https://api.github.com/repos/viewflow/django-material/issues/335/comments","events_url":"https://api.github.com/repos/viewflow/django-material/issues/335/events","html_url":"https://github.com/viewflow/django-material/issues/335","id":257339566,"number":335,"title":"Filter ListModelView by filterset_fields ","user":{"login":"spolpen","id":9380577,"avatar_url":"https://avatars2.githubusercontent.com/u/9380577?v=4","gravatar_id":"","url":"https://api.github.com/users/spolpen","html_url":"https://github.com/spolpen","followers_url":"https://api.github.com/users/spolpen/followers","following_url":"https://api.github.com/users/spolpen/following{/other_user}","gists_url":"https://api.github.com/users/spolpen/gists{/gist_id}","starred_url":"https://api.github.com/users/spolpen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spolpen/subscriptions","organizations_url":"https://api.github.com/users/spolpen/orgs","repos_url":"https://api.github.com/users/spolpen/repos","events_url":"https://api.github.com/users/spolpen/events{/privacy}","received_events_url":"https://api.github.com/users/spolpen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-13T10:58:36Z","updated_at":"2017-09-13T10:58:36Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI have a view with ListModelView and i want to add some filters with filterset_fields like it's explain  [in the doc](http://docs.viewflow.io/frontend_crud.html#material.frontend.views.ListModelView).\r\n\r\n**views.py**\r\n````\r\nclass ContactListView(ListModelView):\r\n    model = Contact\r\n    list_display = ('name','surname','nif')\r\n    filterset_fields = ('nif',)\r\n    template_name = 'addcontact.html'\r\n    def get_context_data(self, **kwargs):\r\n        contacts = get_object_or_404(Contact,pk=1)\r\n        return super(ContactListView, self).get_context_data(contacts=contacts, **kwargs)\r\n    def get_queryset(self):\r\n        qs = Contact.objects.all()\r\n        if(self.request.GET.get('nif')):\r\n            qs = Contact.objects.filter(nif=self.request.GET.get('nif'))\r\n            return qs\r\n        return qs\r\n\r\nclass ContactViewSet(ModelViewSet):\r\n\r\n    model = Contact\r\n    list_display = ('contact', 'expedient')\r\n    list_filter = ('contact',)\r\n\r\n    contact_list_view = [\r\n    r'^(?P<expedient_pk>[^/]+)/addcontact',\r\n    ContactListView.as_view(),\r\n    '{model_name} contact'\r\n]\r\n````\r\n\r\n**urls.py**\r\n```\r\nurlpatterns = [\r\n    url('^$', views.expedient_list, name=\"index\"),\r\n    url(r'addnew/', views.expedient_add_new, name=\"addnew\"),\r\n    url('',include(views.ContactViewSet().urls), name=\"addcontact\"),`\r\n```\r\n\r\nIf i write the url like example.com/app/?nif=value the filter it's works fine, the problem is when it's filter with a input text and a petition by ajax. Which view/url should process the search?"}}
{"actor":{"display_login":"spolpen"}}