title: Django's Distance function not returning a Distance object
body: <p>This is an unexpected behavior that came up on the road to solve this problem with @Nargiza: <a href="https://stackoverflow.com/questions/43474570/3d-distance-calculations-with-geodjango/43807804#43807804">3d distance calculations with GeoDjango</a>.</p>
  
  <p>Following the Django docs on the <a href="https://docs.djangoproject.com/en/1.10/ref/contrib/gis/functions/#django.contrib.gis.db.models.functions.Distance" rel="nofollow noreferrer">Distance</a> <strong>function</strong>:</p>
  
  <blockquote>
    <p>Accepts two geographic fields or expressions and <strong>returns the distance between them, as a Distance object</strong>.</p>
  </blockquote>
  
  <p>And from a <a href="https://docs.djangoproject.com/en/1.10/ref/contrib/gis/measure/#django.contrib.gis.measure.Distance" rel="nofollow noreferrer">Distance</a> <strong>object</strong>, we can get the distance in each and every one of the <a href="https://docs.djangoproject.com/en/1.10/ref/contrib/gis/measure/#supported-units" rel="nofollow noreferrer">supported units</a>.</p>
  
  <p><strong>But:</strong></p>
  
  <p>Let model be:</p>
  
  <pre><code>class MyModel(models.Model):
      ...
      coordinates = models.PointField()
  </code></pre>
  
  <p>then the following:</p>
  
  <pre><code>p1 = MyModel.objects.get(id=1).coordinates
  p2 = MyModel.objects.get(id=2).coordinates
  d = Distance(p1, p2) # This is the function call, 
                       # so d should be a Distance object
  print d.m
  </code></pre>
  
  <p>should print the distance between <code>p1</code> and <code>p2</code> in meters.</p>
  
  <p>Instead, we got the following error:</p>
  
  <pre><code>AttributeError: 'Distance' object has no attribute 'm'
  </code></pre>
  
  <p>We found a workaround eventually (<code>d = Distance(m=p1.distance(p2))</code>) but the question remains:</p>
  
  <p>Why the <code>Distance</code> <strong>function</strong> didn't return a <code>Distance</code> <strong>object</strong>?<br>
  Is this a bug, or we missed something?</p>
  
  <p>Thanks in advance for your time.</p>