src/pyams_thesaurus/zmi/term.py
changeset 57 adc5232e19dd
parent 44 c41afb5121fd
child 74 9f4143b02965
--- a/src/pyams_thesaurus/zmi/term.py	Wed Apr 11 10:32:30 2018 +0200
+++ b/src/pyams_thesaurus/zmi/term.py	Wed Apr 11 10:48:24 2018 +0200
@@ -119,15 +119,21 @@
             return super(ThesaurusTermAJAXAddForm, self).get_ajax_output(changes)
         else:
             label = changes.label.replace("'", "'")
-            return {'status': 'callback',
-                    'callback': 'PyAMS_thesaurus.tree.findTerm',
-                    'options': {'term': label}}
+            return {
+                'status': 'callback',
+                'callback': 'PyAMS_thesaurus.tree.findTerm',
+                'options': {
+                    'term': label
+                }
+            }
 
 
 @pagelet_config(name='properties.html', context=IThesaurusTerm, layer=IPyAMSLayer, permission=VIEW_PERMISSION)
 class ThesaurusTermEditForm(AdminDialogEditForm):
     """Thesaurus term edit form"""
 
+    prefix = 'term_properties.'
+
     @property
     def title(self):
         return self.context.label
@@ -246,15 +252,23 @@
     def get_ajax_output(self, changes):
         if self.generic_changed:
             label = self.context.label.replace("'", "'")
-            return {'status': 'reload',
-                    'callback': 'PyAMS_thesaurus.tree.findTerm',
-                    'options': {'term': label}}
+            return {
+                'status': 'reload',
+                'callback': 'PyAMS_thesaurus.tree.findTerm',
+                'options': {
+                    'term': label
+                }
+            }
         else:
             term_changes = changes.get(IThesaurusTerm, ())
             if ('status' in term_changes) or ('label' in term_changes):
                 label = (self.context.generic or self.context).label.replace("'", "'")
-                return {'status': 'callback',
-                        'callback': 'PyAMS_thesaurus.tree.updateTerm',
-                        'options': {'term': label}}
+                return {
+                    'status': 'callback',
+                    'callback': 'PyAMS_thesaurus.tree.updateTerm',
+                    'options': {
+                        'term': label
+                    }
+                }
             else:
                 return super(ThesaurusTermAJAXEditForm, self).get_ajax_output(changes)