summaryrefslogtreecommitdiff
path: root/gstudio/admin/attribute_booleanfield.py
diff options
context:
space:
mode:
authorAnuja <anujag@anujag-Latitude-D630.(none)>2012-06-11 10:29:31 +0530
committerAnuja <anujag@anujag-Latitude-D630.(none)>2012-06-11 10:29:31 +0530
commit8c082e55fb75386b9f85f66bf4bbb4e1e7a03765 (patch)
tree7623a718917fb9622a87f180449e7faeba4e7b86 /gstudio/admin/attribute_booleanfield.py
parent8fe8e36c845a39af3925457771a24f4e3a12b86b (diff)
downloadgnowsys-8c082e55fb75386b9f85f66bf4bbb4e1e7a03765.tar.gz
Modified Attribute datatype admin classes for dynamically add/change attributes
Diffstat (limited to 'gstudio/admin/attribute_booleanfield.py')
-rw-r--r--gstudio/admin/attribute_booleanfield.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/gstudio/admin/attribute_booleanfield.py b/gstudio/admin/attribute_booleanfield.py
index 17c3efe7..e5d29fed 100644
--- a/gstudio/admin/attribute_booleanfield.py
+++ b/gstudio/admin/attribute_booleanfield.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 AttributeBooleanFieldAdminForm
from gstudio.settings import GSTUDIO_VERSIONING
import reversion
@@ -10,4 +10,11 @@ if GSTUDIO_VERSIONING == True:
else:
parent_class = admin.ModelAdmin
class AttributeBooleanFieldAdmin(parent_class):
- pass
+ fieldsets=((_('AttributeBooleanField'),{'fields': ('attributetype','attributetype_scope','subject','subject_scope','svalue','value_scope','value')}),
+
+)
+ prepopulated_fields = {'svalue': ('value',)}
+ def save_model(self, request, attributebooleanfield, form, change):
+ attributebigintegerfield.title = attributeboofield.composed_sentence
+ attributebigintegerfield.slug = slugify(attributebigintegerfield.title)
+ attributebigintegerfield.save()