diff options
author | anuja <anuja@labadmin-Vostro1510.(none)> | 2012-07-18 16:54:40 +0530 |
---|---|---|
committer | anuja <anuja@labadmin-Vostro1510.(none)> | 2012-07-18 16:54:40 +0530 |
commit | 0e1ae1d29b9ce5b9b55984d5f2207ddef3fa187d (patch) | |
tree | 17e08c495fe135c6a1958818cb15241f5344d9b1 /gstudio/admin/relationspecification.py | |
parent | 70558a843bf579d0ec62c9acbd98e249bdaf8103 (diff) | |
download | gnowsys-0e1ae1d29b9ce5b9b55984d5f2207ddef3fa187d.tar.gz |
Added "metatypes" field to some tables in models
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() + + |