diff options
Diffstat (limited to 'gstudio/admin/nodespecification.py')
-rw-r--r-- | gstudio/admin/nodespecification.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gstudio/admin/nodespecification.py b/gstudio/admin/nodespecification.py index f55bd05..0be8878 100644 --- a/gstudio/admin/nodespecification.py +++ b/gstudio/admin/nodespecification.py @@ -1,6 +1,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 NodeSpecificationAdminForm import reversion @@ -11,4 +12,11 @@ else: parent_class = admin.ModelAdmin class NodeSpecificationAdmin(parent_class): - pass + fieldsets=((_('NodeSpecification'),{'fields': ('metatypes','title','relations','attributes','subject','slug')}), + ) + prepopulated_fields = {'slug': ('title', )} + def save_model(self, request,nodespecification, form, change): + #nodespecification.title = nodespecification.composed_subject + nodespecification.slug = slugify(nodespecification.title) + nodespecification.save() + |