Permalink
Browse files

Merge pull request #281 from iogoinc/issue-246

Make django-taggit map and layer keywords optional
  • Loading branch information...
2 parents b6e94fd + 3544a67 commit 13494ed61365662c5a449efa92598a870d5fbc98 @jj0hns0n jj0hns0n committed Jun 13, 2012
Showing with 7 additions and 5 deletions.
  1. +2 −2 src/GeoNodePy/geonode/maps/models.py
  2. +5 −3 src/GeoNodePy/geonode/maps/views.py
@@ -694,7 +694,7 @@ class Layer(models.Model, PermissionLevelMixin):
# see poc property definition below
# section 3
- keywords = TaggableManager(_('keywords'), help_text=_("A space or comma-separated list of keywords"))
+ keywords = TaggableManager(_('keywords'), help_text=_("A space or comma-separated list of keywords"), blank=True)
keywords_region = models.CharField(_('keywords region'), max_length=3, choices= COUNTRIES, default = 'USA')
constraints_use = models.CharField(_('constraints use'), max_length=255, choices = [(x, x) for x in CONSTRAINT_OPTIONS], default='copyright')
constraints_other = models.TextField(_('constraints other'), blank=True, null=True)
@@ -1212,7 +1212,7 @@ class Map(models.Model, PermissionLevelMixin):
last_modified = models.DateTimeField(auto_now_add=True)
# The last time the map was modified.
- keywords = TaggableManager(_('keywords'), help_text=_("A space or comma-separated list of keywords"))
+ keywords = TaggableManager(_('keywords'), help_text=_("A space or comma-separated list of keywords"), blank=True)
def __unicode__(self):
return '%s by %s' % (self.title, (self.owner.username if self.owner else "<Anonymous>"))
@@ -65,7 +65,7 @@ def _baselayer(lyr, order):
def bbox_to_wkt(x0, x1, y0, y1, srid="4326"):
return 'SRID='+srid+';POLYGON(('+x0+' '+y0+','+x0+' '+y1+','+x1+' '+y1+','+x1+' '+y0+','+x0+' '+y0+'))'
class ContactForm(forms.ModelForm):
- keywords = taggit.forms.TagField()
+ keywords = taggit.forms.TagField(required=False)
class Meta:
model = Contact
exclude = ('user',)
@@ -84,7 +84,9 @@ class LayerForm(forms.ModelForm):
metadata_author = forms.ModelChoiceField(empty_label = "Person outside GeoNode (fill form)",
label = "Metadata Author", required=False,
queryset = Contact.objects.exclude(user=None))
- keywords = taggit.forms.TagField()
+
+ keywords = taggit.forms.TagField(required=False)
+
class Meta:
model = Layer
exclude = ('contacts','workspace', 'store', 'name', 'uuid', 'storeType', 'typename')
@@ -100,7 +102,7 @@ class PocForm(forms.Form):
class MapForm(forms.ModelForm):
- keywords = taggit.forms.TagField()
+ keywords = taggit.forms.TagField(required=False)
class Meta:
model = Map
exclude = ('contact', 'zoom', 'projection', 'center_x', 'center_y', 'owner')

0 comments on commit 13494ed

Please sign in to comment.