def ajax(self, r, **attr):

        # Get Summary Page Configuration
        config = self._get_config(self.resource)

        widget_id = r.get_vars.get("w")
        i = 0
        for section in config:
            widgets = section.get("widgets", [])
            for widget in widgets:
                if widget_id == "summary-%s" % i:
                    method = widget.get("method", None)
                    output = None
                    if callable(method):
                        output = method(r, widget_id=widget_id, **attr)
                    else:
                        handler = r.get_widget_handler(method)
                        if handler is not None:
                            output = handler(r,
                                             method=method,
                                             widget_id=widget_id,
                                             **attr)
                        else:
                            r.error(405, current.ERROR.BAD_METHOD)
                    return output
                i += 1

        # Not found?
        return None

    # -------------------------------------------------------------------------
Render a specific widget for pulling-in via AJAX
dataset/ETHPy150Open sahana/eden/modules/s3/s3summary.py/S3Summary.ajax