From 6bcf5be9e55074e512ec385f2eefaae389c2df2d Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Wed, 6 May 2009 06:54:55 -0200 Subject: [PATCH] A few tweaks to the clusterer and models. Now to work on the HTML. --- djangopeoplenet/djangopeople/clustering.py | 1 + djangopeoplenet/djangopeople/models.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/djangopeoplenet/djangopeople/clustering.py b/djangopeoplenet/djangopeople/clustering.py index 3e65a44..10e127b 100644 --- a/djangopeoplenet/djangopeople/clustering.py +++ b/djangopeoplenet/djangopeople/clustering.py @@ -24,6 +24,7 @@ def save_clusters(clusters, zoom): longitude = cluster.mean[1], number = len(cluster), zoom = zoom, + djangoperson_id = len(cluster) == 1 and list(cluster.points)[0][2] or None, ) diff --git a/djangopeoplenet/djangopeople/models.py b/djangopeoplenet/djangopeople/models.py index a261151..86fba74 100644 --- a/djangopeoplenet/djangopeople/models.py +++ b/djangopeoplenet/djangopeople/models.py @@ -404,5 +404,9 @@ class ClusteredPoint(models.Model): number = models.IntegerField() djangoperson = models.ForeignKey(DjangoPerson, blank=True, null=True) + def __unicode__(self): + return "%s people at (%s,%s,z%s)" % (self.number, self.longitude, self.latitude, self.zoom) + class Admin: - pass + list_display = ("zoom", "latitude", "longitude", "number") + ordering = ("zoom",)