@staticmethod
    def crud_button(label=None,
                    tablename=None,
                    name=None,
                    icon=None,
                    _href=None,
                    _id=None,
                    _class=None,
                    _title=None,
                    _target=None,
                    **attr):
        """
            Generate a CRUD action button

            @param label: the link label (None if using CRUD string)
            @param tablename: the name of table for CRUD string selection
            @param name: name of CRUD string for the button label
            @param icon: name of the icon (e.g. "add")
            @param _href: the target URL
            @param _id: the HTML id of the link
            @param _class: the HTML class of the link
            @param _title: the HTML title of the link
            @param _target: the HTML target of the link

            @keyword custom: custom CRUD button (just add classes)
        """

        settings = current.deployment_settings

        # If using Bootstrap then we need to amend our core HTML markup
        bootstrap = settings.ui.formstyle == "bootstrap"

        # Custom button?
        if attr in "custom":
            custom = attr["custom"]
            if custom is None:
                custom = ""
            elif bootstrap and hasattr(custom, "add_class"):
                custom.add_class("btn btn-primary")
            return custom

        # Default class
        if _class is None and not bootstrap:
            _class = "action-btn"

        # Default label
        if name:
            labelstr = S3CRUD.crud_string(tablename, name)
        else:
            labelstr = str(label)

        # Show icon on button?
        if icon and settings.get_ui_use_button_icons():
            button = A(ICON(icon), labelstr, _id=_id, _class=_class)
        else:
            button = A(labelstr, _id=_id, _class=_class)

        # Button attributes
        if _href:
            button["_href"] = _href
        if _title:
            button["_title"] = _title
        if _target:
            button["_target"] = _target

        # Additional classes?
        if bootstrap:
            button.add_class("btn btn-primary")
        return button

    # -------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/s3/s3crud.py/S3CRUD.crud_button/swapped operands of `in`