From 75e63566a68efbdefa62cff6c618c07f3306ec7c Mon Sep 17 00:00:00 2001 From: Sanj Date: Sat, 20 Aug 2011 15:41:23 +0530 Subject: [PATCH] timeframe models bug - add timeframe and ftypes to admin --- gazetteer/places/admin.py | 5 +++-- gazetteer/places/models.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gazetteer/places/admin.py b/gazetteer/places/admin.py index 17fe197..7fe196b 100644 --- a/gazetteer/places/admin.py +++ b/gazetteer/places/admin.py @@ -14,7 +14,8 @@ class FeatureAdmin(admin.GeoModelAdmin): # default_lon = 72.855211097628413 # default_lat = 19.415775291486027 # default_zoom = 4 -# extra_js = ['http://openstreetmap.org/openlayers/OpenStreetMap.js'] + extra_js = ['http://openlayers.org/dev/OpenLayers.js', 'http://openstreetmap.org/openlayers/OpenStreetMap.js'] admin.site.register(Feature, FeatureAdmin) - +admin.site.register(TimeFrame) +admin.site.register(FeatureType) diff --git a/gazetteer/places/models.py b/gazetteer/places/models.py index 5ff5cd5..affbb7f 100644 --- a/gazetteer/places/models.py +++ b/gazetteer/places/models.py @@ -18,7 +18,7 @@ class Feature(models.Model): feature_type = models.ForeignKey("FeatureType", null=True, blank=True) geometry = models.GeometryField() is_primary = models.BooleanField(default=True) - time_frame = models.OneToOneField("TimeFrame", null=True, blank=True) + time_frame = models.ForeignKey("TimeFrame", null=True, blank=True) relationships = models.ManyToManyField("Feature", through='Relationship', blank=True) objects = models.GeoManager()