title: Filter query with range within Model
body: <p>I'm trying to execute a query with the <a href="https://docs.djangoproject.com/en/1.10/ref/models/querysets/#range" rel="nofollow noreferrer">range test</a> in my class (MapArea), but I don't seem to have a grasp on the visibility of objects in Models as I get <code>NameError: name 'MapArea' is not defined</code>.</p>
  
  <p>My class is as follows:</p>
  
  <pre><code>class MapArea(models.Model):
  
      lat = models.DecimalField(max_digits=15,decimal_places=6)
      lon = models.DecimalField(max_digits=15,decimal_places=6)
      nearby_streets = MapArea.objects.filter(lat__range=[self.lat - 2, self.lat + 2], lon__range=[self.lon - 2, self.lon + 2])
  
      # Meta
      class Meta:
          abstract = True
  </code></pre>
  
  <p>Setting <code>nearby_streets</code> to <code>MapArea.objects.filter(lat__range=[self.lat - 2, self.lat + 2], lon__range=[self.lon - 2,  self.lon + 2])</code> is what causes the <code>NameError: name 'MapArea' is not defined</code>.</p>
  
  <p>It seems like MapArea should be defined <a href="https://stackoverflow.com/a/4668718/2716435">according to other answers</a>, but I don't seem to be accessing it correctly. How can I access <code>MapArea.objects.filter()</code> in order to use the range test feature?</p>
  
  <p>Thank you in advance.</p>