diff options
Diffstat (limited to 'gstudio/admin/expression.py')
-rw-r--r-- | gstudio/admin/expression.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gstudio/admin/expression.py b/gstudio/admin/expression.py index cebd696..49a6f2d 100644 --- a/gstudio/admin/expression.py +++ b/gstudio/admin/expression.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 ExpressionAdminForm import reversion @@ -12,7 +13,11 @@ else: parent_class = admin.ModelAdmin class ExpressionAdmin(parent_class): - def save_model(self, request, expression, form, change): + fieldsets=((_('Expression'),{'fields': ('metatypes','title','left_term','relationtype','right_term','slug')}), + ) + prepopulated_fields = {'slug': ('title', )} + def save_model(self, request,expression, form, change): expression.title = expression.composed_sentence + expression.slug = slugify(expression.title) expression.save() |