title: Obtain centroid of a queryset of points (PointField) with Django
body: <p>I would need to obtain the centroid of a queryset of points (PointField) with Django</p>
  
  <p>Here are my models:</p>
  
  <pre><code>class GroupOfCities(models.Model)
      geomcentroid = models.PointField(srid=4326, blank=True, null=True)
  
  class City(models.Model):
      centroid = models.PointField(srid=4326, blank=True, null=True)
      groupofcities = models.ForeignKey(GroupOfCities, null=True)
  </code></pre>
  
  <p>I would need to get the centroid of each group of cities and save it to geomcentroid</p>
  
  <p>Example of what I would like to do for one group of cities:</p>
  
  <pre><code>from django.contrib.gis.db.models.functions import Centroid
  
  firstgroupofcities = GroupeOfCities.objects.get(id=1)
  cities = City.objects.filter(groupofcities=firstgroupofcities).annotate(cent=Centroid('centroid'))
  firstgroupofcities.geomcentroid = cities.cent
  firstgroupofcities.save()    
  </code></pre>
  
  <p>But this "Centroid" functionality only works for polygons.</p>
  
  <p>Any clue? </p>