title: Filtering in django rest framework
body: <p>In my project I use django rest framework. To filter the results I use django_filters backend.
  There is my code:</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>from django.db import models
  
  
  class Region(models.Model):
      name = models.CharField(max_length=100, blank=True, null=False)
  
  
  class Town(models.Model):
      region = models.ForeignKey(Region)
      name = models.CharField(max_length=100, blank=True, null=False')
  </code></pre>
  
  <p><strong>filters.py</strong></p>
  
  <pre><code>import django_filters
  from models import Town
  
  
  class TownFilter(django_filters.FilterSet):
      region = django_filters.CharFilter(name="region__name", lookup_type="contains")
      town = django_filters.CharFilter(name="name", lookup_type="contains")
  
      class Meta:
          model = Town
          fields = ['region', 'town']
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>from models import Town
  from rest_framework import generics
  from serializers import TownSerializer
  from filters import TownFilter
  
  
  class TownList(generics.ListAPIView):
      queryset = Town.objects.all()
      serializer_class = TownSerializer
      filter_class = TownFilter
  </code></pre>
  
  <p>So, I can write <strong>?region=Region_name&amp;town=Town_name</strong> to the end of the request url, and the result will be filtered.</p>
  
  <p>But I want to use only one get param in the request url, which can have <strong>region</strong> or <strong>town name</strong> as value. For example <strong>?search=Region_name</strong> and <strong>?search=Town_name</strong>. How can I do this?</p>