diff options
Diffstat (limited to 'gstudio/admin/attribute_commaseparatedintegerfield.py')
-rw-r--r-- | gstudio/admin/attribute_commaseparatedintegerfield.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gstudio/admin/attribute_commaseparatedintegerfield.py b/gstudio/admin/attribute_commaseparatedintegerfield.py index c3701d94..b09d4d40 100644 --- a/gstudio/admin/attribute_commaseparatedintegerfield.py +++ b/gstudio/admin/attribute_commaseparatedintegerfield.py @@ -1,7 +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 AttributeCommaSeparatedIntegerFieldAdminForm from gstudio.settings import GSTUDIO_VERSIONING import reversion @@ -11,4 +11,11 @@ else: parent_class = admin.ModelAdmin class AttributeCommaSeparatedIntegerFieldAdmin(parent_class): - pass + fieldsets=((_('AttributeCommaSeparatedIntegerField'),{'fields': ('attributetype','attributetype_scope','subject','subject_scope','svalue','value_scope','value')}), + +) + prepopulated_fields = {'svalue': ('value',)} + def save_model(self, request, attributecommaseperatedintegerfield, form, change): + attributecommaseperatedintegerfield.title = attributecommaseperatedintegerfield.composed_sentence + attributecommaseperatedintegerfield.slug = slugify(attributecommaseperatedintegerfield.title) + attributecommaseperatedintegerfield.save() |