title: Django-filter : working query is not working inside filtering method
body: <p>I'm building a filtering system with django-filters and I have a problem when using a custom filtering method. I have two models <code>Plat</code> and <code>UserAdvanced</code> which both have a <code>location</code> attribute corresponding to a Point from GeoDjango (it doesn't matter if you are not familiar with GeoDjango, the error is not GeoDjango related).</p>
  
  <p>models.py</p>
  
  <pre><code>class UserAdvanced(models.Model):
      location = models.PointField(blank = True, null = True)
  
  class Plat(models.Model):
      location = models.PointField(blank = True, null = True)
  </code></pre>
  
  <p>I want to filter all the <code>Plat</code> objects that are located at a distance less or equal than a value from the location of a <code>UserAdvanced</code> object. When I'm doing this in the shell, it works perfectly :</p>
  
  <pre><code>location2 = useradvanced_object.location
  Plat.objects.filter(location__distance_lte=(location2, D(m=1000)))
  </code></pre>
  
  <p>Note : <code>distance</code> is a build-in function of GeoDjango that can be applied to a point.</p>
  
  <p>The problem is that, when I'm doing exactly the same thing inside a filtering method, I get an error. Here is the code :</p>
  
  <p>filters.py</p>
  
  <pre><code>from actualites.models import Plat
  from django.contrib.gis.geos import Point
  from django.contrib.gis.geos import *
  from django.contrib.gis.measure import D
  import django_filters
  
  class PlatFilter(django_filters.FilterSet):
      def __init__(self, *args, **kwargs):
          self.user = kwargs.pop('user')
          super(PlatFilter, self).__init__(*args, **kwargs)
  
      distance_filter = django_filters.NumberFilter(
          field_name='location', method='distance_method'
      )
  
      class Meta:
          model = Plat
  
      def distance_method(self, queryset, name, value):
          location2 = self.user.useradvanced.localisation
          return queryset.filter(location__distance_lte(location2, D(m = value)))
  </code></pre>
  
  <p>I get this error : </p>
  
  <pre><code>NameError at /
  name 'location__distance_lte' is not defined
  </code></pre>
  
  <p>I've tried using name instead of location, using _ instead __, nothing works. I can't understand why since it works perfectly in the shell. I've verified that everything is well installed and imported in the virtual environment. A little help would be greatly appreciated.</p>
  
  <p>Thanks in advance !</p>
  
  <p>Note : here are the local vars if it can help :</p>
  
  <pre><code>location2   &lt;Point object at 0x7f06d91254d8&gt;
  name        'location'
  queryset    &lt;QuerySet [&lt;Plat: PLAT TEST&gt;, &lt;Plat: Pâtes aux poivrons&gt;, &lt;Plat: Boeuf bourguingnon&gt;, &lt;Plat: Burrito mexicain&gt;]&gt;
  self        &lt;actualites.filters.PlatFilter object at 0x7f06d804e5f8&gt;
  value       Decimal('1000000000000')
  </code></pre>