diff options
Diffstat (limited to 'gstudio/admin/relationspecification.py')
-rw-r--r-- | gstudio/admin/relationspecification.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gstudio/admin/relationspecification.py b/gstudio/admin/relationspecification.py index 6018236..8f57dc1 100644 --- a/gstudio/admin/relationspecification.py +++ b/gstudio/admin/relationspecification.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 RelationSpecificationAdminForm import reversion @@ -12,4 +13,12 @@ else: parent_class = admin.ModelAdmin class RelationSpecificationAdmin(parent_class): - pass + fieldsets=((_('RelationSpecification'),{'fields': ('metatypes','title','relationtype','subjects','slug')}), + ) + prepopulated_fields = {'slug': ('title', )} + def save_model(self, request,relationspecification, form, change): + #relationspecification.title = relationspecification.composed_subject + relationspecification.slug = slugify(relationspecification.title) + relationspecification.save() + + |