summaryrefslogtreecommitdiff
path: root/gstudio/admin/attribute_integerfield.py
diff options
context:
space:
mode:
Diffstat (limited to 'gstudio/admin/attribute_integerfield.py')
-rw-r--r--gstudio/admin/attribute_integerfield.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/gstudio/admin/attribute_integerfield.py b/gstudio/admin/attribute_integerfield.py
index b98251f0..bfc84598 100644
--- a/gstudio/admin/attribute_integerfield.py
+++ b/gstudio/admin/attribute_integerfield.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 AttributeIntegerFieldAdminForm
from gstudio.settings import GSTUDIO_VERSIONING
import reversion
@@ -12,4 +12,12 @@ else:
class AttributeIntegerFieldAdmin(parent_class):
- pass
+ fieldsets=((_('AttributIntegerField'),{'fields': ('attributetype','attributetype_scope','subject','subject_scope','svalue','value_scope','value')}),
+
+)
+ prepopulated_fields = {'svalue': ('value', )}
+ def save_model(self, request, attributeintegerfield, form, change):
+ attributeintegerfield.title = attributeintegerfield.composed_sentence
+ attributeintegerfield.slug = slugify(attributeintegerfield.title)
+ attributeintegerfield.save()
+