diff options
author | Anuja <anujag@anujag-Latitude-D630.(none)> | 2012-06-11 10:29:31 +0530 |
---|---|---|
committer | Anuja <anujag@anujag-Latitude-D630.(none)> | 2012-06-11 10:29:31 +0530 |
commit | 8c082e55fb75386b9f85f66bf4bbb4e1e7a03765 (patch) | |
tree | 7623a718917fb9622a87f180449e7faeba4e7b86 /gstudio/admin/attribute_nullbooleanfield.py | |
parent | 8fe8e36c845a39af3925457771a24f4e3a12b86b (diff) | |
download | gnowsys-8c082e55fb75386b9f85f66bf4bbb4e1e7a03765.tar.gz |
Modified Attribute datatype admin classes for dynamically add/change attributes
Diffstat (limited to 'gstudio/admin/attribute_nullbooleanfield.py')
-rw-r--r-- | gstudio/admin/attribute_nullbooleanfield.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gstudio/admin/attribute_nullbooleanfield.py b/gstudio/admin/attribute_nullbooleanfield.py index 6a4d7f1..279677d 100644 --- a/gstudio/admin/attribute_nullbooleanfield.py +++ b/gstudio/admin/attribute_nullbooleanfield.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 AttributeNullBooleanFieldAdminForm from gstudio.settings import GSTUDIO_VERSIONING import reversion @@ -11,4 +11,12 @@ else: parent_class = admin.ModelAdmin class AttributeNullBooleanFieldAdmin(parent_class): - pass + fieldsets=((_('AttributeNullBooleanField'),{'fields': ('attributetype','attributetype_scope','subject','subject_scope','svalue','value_scope','value')}), + +) + prepopulated_fields = {'svalue': ('value', )} + def save_model(self, request, attributenullbooleanfield, form, change): + attributenullbooleanfield.title = attributenullbooleanfield.composed_sentence + attributenullbooleanfield.slug = slugify(attributenullbooleanfield.title) + attributenullbooleanfield.save() + |