def __call__(self):

        response = current.response

        output = {}
        #output["title"] = response.title = current.deployment_settings.get_system_name()

        s3 = response.s3
        # Image Carousel
        s3.jquery_ready.append('''$('#myCarousel').carousel()''')

        # Latest 4 Requests
        s3db = current.s3db
        list_id = "latest_reqs"
        layout = s3db.req_req_list_layout
        limit = 4
        resource = s3db.resource("req_req")
        s3db.req_customise_req_fields()
        list_fields = s3db.get_config("req_req", "list_fields")
        from s3.s3query import FS
        resource.add_filter(FS("cancel") != True)
        # Order with most recent first
        orderby = "date desc"
        output["latest_reqs"] = latest_records(resource, layout, list_id, limit, list_fields, orderby)

        # Latest 4 Offers
        list_id = "latest_offers"
        layout = s3db.req_commit_list_layout
        #limit = 4

        resource = s3db.resource("req_commit")
        s3db.req_customise_commit_fields()
        list_fields = s3db.get_config("req_commit", "list_fields")
        resource.add_filter(FS("cancel") != True)
        # Order with most recent first
        #orderby = "date desc"
        output["latest_offers"] = latest_records(resource, layout, list_id, limit, list_fields, orderby)

        # What We Do
        table = s3db.cms_post
        ltable = s3db.cms_post_module
        query = (ltable.module == "default") & \
                (ltable.resource == "index") & \
                (ltable.post_id == table.id) & \
                (table.deleted != True)
        item = current.db(query).select(table.id,
                                        table.body,
                                        limitby=(0, 1)).first()
        if item:
            what_we_do = DIV(XML(item.body))
            if current.auth.s3_has_role("ADMIN"):
                if s3.crud.formstyle == "bootstrap":
                    _class = "btn"
                else:
                    _class = "action-btn"
                what_we_do.append(A(current.T("Edit"),
                                    _href=URL(c="cms", f="post",
                                              args=[item.id, "update"],
                                              vars={"module": "default",
                                                    "resource": "index",
                                                    }),
                                    _class=_class % "%s cms-edit"))
        else:
            what_we_do = DIV()
            if current.auth.s3_has_role("ADMIN"):
                if s3.crud.formstyle == "bootstrap":
                    _class = "btn"
                else:
                    _class = "action-btn"
                what_we_do.append(A(current.T("Edit"),
                                    _href=URL(c="cms", f="post",
                                              args=["create"],
                                              vars={"module": "default",
                                                    "resource": "index",
                                                    }),
                                    _class="%s cms-edit" % _class))

        output["what_we_do"] = what_we_do

        self._view(THEME, "index.html")
        return output

# =============================================================================
dataset/ETHPy150Open sahana/eden/modules/templates/Philippines/controllers.py/index.__call__/swapped operands of `%`