diff options
Diffstat (limited to 'gstudio/admin/attributespecification.py')
-rw-r--r-- | gstudio/admin/attributespecification.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gstudio/admin/attributespecification.py b/gstudio/admin/attributespecification.py index 781343b..8e9bc5f 100644 --- a/gstudio/admin/attributespecification.py +++ b/gstudio/admin/attributespecification.py @@ -2,6 +2,7 @@ from django.contrib import admin from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ +from django.template.defaultfilters import slugify from gstudio.admin.forms import AttributeSpecificationAdminForm from gstudio.settings import GSTUDIO_VERSIONING @@ -12,4 +13,12 @@ else: parent_class = admin.ModelAdmin class AttributeSpecificationAdmin(parent_class): - pass + fieldsets=((_('AttributeSpecification'),{'fields': ('metatypes','title','attributetype','subjects','slug')}), + +) + prepopulated_fields = {'slug': ('title', )} + def save_model(self, request, attributespecification, form, change): + #attributespecification.title = attributespecification.composed_subject + attributespecification.slug = slugify(attributespecification.title) + attributespecification.save() + |