--- a/src/pyams_form/form.py Tue Jun 12 10:47:03 2018 +0200
+++ b/src/pyams_form/form.py Tue Jun 12 10:49:14 2018 +0200
@@ -722,8 +722,15 @@
new_class = type('AJAX' + ob.__name__, (base, ob), cdict)
try:
# check if current form is overriding "get_ajax_output" method
- if not ob.get_ajax_output.__qualname__.startswith('AJAXForm.'): # redefined method
- new_class.get_ajax_output = ob.get_ajax_output
+ if base not in (AJAXAddForm, AJAXEditForm): # custom base
+ basename = base.__qualname__
+ baseklassname, _ = base.get_ajax_output.__qualname__.split('.')
+ if baseklassname != basename: # overriden method
+ new_class.get_ajax_output = ob.get_ajax_output
+ else:
+ baseklassname, _ = ob.get_ajax_output.__qualname__.split('.')
+ if baseklassname not in ('AJAXForm', 'AJAXEditForm'): # overriden method
+ new_class.get_ajax_output = ob.get_ajax_output
except AttributeError:
pass