summaryrefslogtreecommitdiff
path: root/gstudio/admin/attribute_floatfield.py
diff options
context:
space:
mode:
authorNagarjuna G <nagarjun@gnowledge.org>2012-06-11 13:48:30 +0530
committerNagarjuna G <nagarjun@gnowledge.org>2012-06-11 13:48:30 +0530
commit2715b83808e0451f2de37e601ffca2398410653c (patch)
tree86647da8e6321831d7d8d3b5b61d428acc1a97e1 /gstudio/admin/attribute_floatfield.py
parente494a5a9b45f14b971eeb3a4cea32601e79c5cfe (diff)
parent833243ea72813e1e3c4256fc00b9e0576e66cf06 (diff)
downloadgnowsys-2715b83808e0451f2de37e601ffca2398410653c.tar.gz
Merge branch 'master' of github.com:gnowgi/gnowsys-studio
Diffstat (limited to 'gstudio/admin/attribute_floatfield.py')
-rw-r--r--gstudio/admin/attribute_floatfield.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/gstudio/admin/attribute_floatfield.py b/gstudio/admin/attribute_floatfield.py
index 1563f92d..23ab024d 100644
--- a/gstudio/admin/attribute_floatfield.py
+++ b/gstudio/admin/attribute_floatfield.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 AttributeFloatFieldAdminForm
from gstudio.settings import GSTUDIO_VERSIONING
import reversion
@@ -11,4 +11,12 @@ else:
parent_class = admin.ModelAdmin
class AttributeFloatFieldAdmin(parent_class):
- pass
+ fieldsets=((_('AttributeFloatField'),{'fields': ('attributetype','attributetype_scope','subject','subject_scope','svalue','value_scope','value')}),
+
+)
+ prepopulated_fields = {'svalue': ('value', )}
+ def save_model(self, request, attributefloatfield, form, change):
+ attributefloatfield.title = attributefloatfield.composed_sentence
+ attributefloatfield.slug = slugify(attributefloatfield.title)
+ attributefloatfield.save()
+