From 76d725e9358d67eef35cbb6c5e1ac9566dff50fa Mon Sep 17 00:00:00 2001 From: Kabir Date: Thu, 3 May 2012 12:28:16 +0530 Subject: filter added to attribute form in admin interface --- gstudio/admin/attribute.py | 6 +++--- gstudio/static/gstudio/js/gstudio.js | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'gstudio') diff --git a/gstudio/admin/attribute.py b/gstudio/admin/attribute.py index 7a34cb8e..b66f66e3 100644 --- a/gstudio/admin/attribute.py +++ b/gstudio/admin/attribute.py @@ -1,4 +1,4 @@ -"""MetatypeAdmin for Gstudio""" +"""AttributeAdmin for Gstudio""" from django.contrib import admin from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ugettext_lazy as _ @@ -9,13 +9,13 @@ import reversion from django.template.defaultfilters import slugify class AttributeAdmin(reversion.VersionAdmin): - fieldsets=((_('Attribute'),{'fields': ('subject','subject_scope','attributetype','attributetype_scope','svalue','value_scope','last_update','creation_date')}), + fieldsets=((_('Attribute'),{'fields': ('attributetype','attributetype_scope','subject','subject_scope','svalue','value_scope')}), ) class Media: - js = ("gstudio/js/gstudiojs.js",) + js = ("gstudio/js/gstudio.js",) def save_model(self, request, attribute, form, change): attribute.title = attribute.composed_sentence diff --git a/gstudio/static/gstudio/js/gstudio.js b/gstudio/static/gstudio/js/gstudio.js index d8d9d608..7ed67e24 100644 --- a/gstudio/static/gstudio/js/gstudio.js +++ b/gstudio/static/gstudio/js/gstudio.js @@ -47,23 +47,24 @@ $ = django.jQuery $("#id_attributetype").change(function() { test = $("#id_attributetype").val() - url = "/nodetypes/ajax/?id=" + test + url = "/nodetypes/ajax/ajaxattribute/?id=" + test + $.get(url, - function(data){ + function(data){ - $("#id_subject").empty() + $("#id_subject").empty() - for (var key in data) { - $('#id_subject').append( - $('').val(key).html(data[key]) - ); - } + for (var key in data) { + $('#id_subject').append( + $('').val(key).html(data[key]) + ); + } - }); + }); }); -- cgit v1.2.3-70-g09d2