summaryrefslogtreecommitdiff
path: root/chimere/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/models.py')
-rw-r--r--chimere/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/chimere/models.py b/chimere/models.py
index 8bff588..2ac1ac5 100644
--- a/chimere/models.py
+++ b/chimere/models.py
@@ -195,6 +195,14 @@ class SubCategory(models.Model):
return [(category, sub_cats) for category, sub_cats \
in sub_categories.items()]
+ @classmethod
+ def getAvailableTuples(cls, area_name=None):
+ cats = []
+ for cat, subcats in cls.getAvailable(area_name=area_name):
+ cats.append((unicode(cat),
+ [(subcat.pk, subcat.name) for subcat in subcats]))
+ return cats
+
IMPORTERS = {'KML':KMLManager,
'OSM':OSMManager,
'SHP':ShapefileManager