web/hdalab/models/dataviz.py
changeset 123 94fc5f5b5cfd
parent 122 fde8335a037c
child 135 dd6578e36a57
--- a/web/hdalab/models/dataviz.py	Wed Feb 22 18:55:35 2012 +0100
+++ b/web/hdalab/models/dataviz.py	Thu Feb 23 19:45:00 2012 +0100
@@ -5,7 +5,7 @@
 @author: ymh
 '''
 from django.db import models
-from hdabo.models import Tag
+from hdabo.models import Tag, Datasheet
 
 
 class TagYears(models.Model):
@@ -26,14 +26,6 @@
     class Meta:
         app_label = 'hdalab'
 
-#class CountryCode(models.Model):
-#
-#    label = models.CharField(max_length=1024, unique=True, blank=False, null=False, db_index=True)
-#    isocode = models.CharField(max_length=3, unique=True, blank=False, null=False, db_index=True)
-#    
-#    class Meta:
-#        app_label = 'hdalab'
-
 class Country(models.Model):
     
     dbpedia_uri = models.URLField(verify_exists=False, max_length=255, blank=False, null=False, db_index=True, unique=True)
@@ -67,4 +59,21 @@
     
     class Meta:
         app_label = 'hdalab'
-        
+
+class InseeCoords(models.Model):
+    
+    insee = models.IntegerField(primary_key=True)
+    city_name = models.CharField(max_length=255, blank=False, null=False)
+    latitude = models.FloatField(blank=False, null=False)
+    longitude = models.FloatField(blank=False, null=False)
+    
+    class Meta:
+        app_label = 'hdalab'
+
+class DatasheetExtras(models.Model):
+    
+    datasheet = models.OneToOneField(Datasheet, related_name="extras", db_index=True)
+    insee = models.ForeignKey(InseeCoords, blank=True, null=True, db_index=True)
+    
+    class Meta:
+        app_label = 'hdalab'
\ No newline at end of file