summaryrefslogtreecommitdiff
path: root/gstudio/admin/attribute_filepathfield.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_filepathfield.py
parent8fe8e36c845a39af3925457771a24f4e3a12b86b (diff)
downloadgnowsys-8c082e55fb75386b9f85f66bf4bbb4e1e7a03765.tar.gz
Modified Attribute datatype admin classes for dynamically add/change attributes
Diffstat (limited to 'gstudio/admin/attribute_filepathfield.py')
-rw-r--r--gstudio/admin/attribute_filepathfield.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/gstudio/admin/attribute_filepathfield.py b/gstudio/admin/attribute_filepathfield.py
index c65346d..cf570a7 100644
--- a/gstudio/admin/attribute_filepathfield.py
+++ b/gstudio/admin/attribute_filepathfield.py
@@ -1,8 +1,7 @@
from django.contrib import admin
from django.core.urlresolvers import NoReverseMatch
from django.utils.translation import ugettext_lazy as _
-
-from gstudio.admin.forms import AttributeFilePathFieldAdminForm
+from django.template.defaultfilters import slugify
from gstudio.settings import GSTUDIO_VERSIONING
import reversion
if GSTUDIO_VERSIONING == True:
@@ -11,4 +10,12 @@ else:
parent_class = admin.ModelAdmin
class AttributeFilePathFieldAdmin(parent_class):
- pass
+ fieldsets=((_('AttributeFilePathField'),{'fields': ('attributetype','attributetype_scope','subject','subject_scope','svalue','value_scope','value')}),
+
+)
+ prepopulated_fields = {'svalue': ('value', )}
+ def save_model(self, request, attributefilepathfield, form, change):
+ attributefilepathfield.title = attributefilepathfield.composed_sentence
+ attributefilepathfield.slug = slugify(attributefilepathfield.title)
+ attributefilepathfield.save()
+