This commit is contained in:
Karen 2011-08-25 16:33:39 +05:30
commit a409b04767
2 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,6 @@
from django.contrib.gis import admin
from models import *
from django import forms
class FeatureNamesInline(admin.StackedInline):
model = Name
@ -10,6 +11,17 @@ class FeatureRelationInline(admin.TabularInline):
extra = 1
fk_name = 'feature1'
class featuresForm(forms.ModelForm):
url = forms.CharField(label='URI',
required=True,
widget=forms.TextInput(attrs={'size': '40'}))
# exclude = ('info',)
class Meta:
model = Feature
class FeatureAdmin(admin.OSMGeoAdmin):
search_fields = ['preferred_name']
# list_filter = ('feature_type',)
@ -18,6 +30,7 @@ class FeatureAdmin(admin.OSMGeoAdmin):
list_per_page = 12
openlayers_url = 'http://openlayers.org/dev/OpenLayers.js'
openlayers_img_path = None
form = featuresForm
# map_template = 'gis/admin/osm.html'
# default_lon = 72.855211097628413
# default_lat = 19.415775291486027

View File

@ -13,7 +13,7 @@ class AuthorityRecord(models.Model):
class Feature(models.Model):
url = models.CharField(max_length=512, unique=True)
url = models.CharField(max_length=512, unique=True, verbose_name="URI")
preferred_name = models.CharField(max_length=512)
feature_type = models.ForeignKey("FeatureType", null=True, blank=True)
geometry = models.GeometryField()
@ -79,7 +79,7 @@ GRANULARITY_CHOICES = (
)
class TimeFrame(models.Model):
description = models.TextField(blank=True)
description = models.CharField(max_length=100, blank=True)
start_date = models.DateField()
end_date = models.DateField() #add default to now
start_granularity = models.CharField(max_length=64, choices=GRANULARITY_CHOICES)