aboutsummaryrefslogtreecommitdiff
path: root/tagging
diff options
context:
space:
mode:
Diffstat (limited to 'tagging')
-rw-r--r--tagging/admin.py10
-rw-r--r--tagging/forms.py4
2 files changed, 11 insertions, 3 deletions
diff --git a/tagging/admin.py b/tagging/admin.py
index 4c1ef38..bec3922 100644
--- a/tagging/admin.py
+++ b/tagging/admin.py
@@ -1,5 +1,13 @@
from django.contrib import admin
from tagging.models import Tag, TaggedItem
+from tagging.forms import TagAdminForm
+
+class TagAdmin(admin.ModelAdmin):
+ form = TagAdminForm
admin.site.register(TaggedItem)
-admin.site.register(Tag)
+admin.site.register(Tag, TagAdmin)
+
+
+
+
diff --git a/tagging/forms.py b/tagging/forms.py
index a70ac6b..a2d9fd9 100644
--- a/tagging/forms.py
+++ b/tagging/forms.py
@@ -8,7 +8,7 @@ from tagging import settings
from tagging.models import Tag
from tagging.utils import parse_tag_input
-class AdminTagForm(forms.ModelForm):
+class TagAdminForm(forms.ModelForm):
class Meta:
model = Tag
@@ -16,7 +16,7 @@ class AdminTagForm(forms.ModelForm):
value = self.cleaned_data['name']
tag_names = parse_tag_input(value)
if len(tag_names) > 1:
- raise ValidationError(_('Multiple tags were given.'))
+ raise forms.ValidationError(_('Multiple tags were given.'))
elif len(tag_names[0]) > settings.MAX_TAG_LENGTH:
raise forms.ValidationError(
_('A tag may be no more than %s characters long.') %