@staticmethod
    def case_event_type_onaccept(form):
        """
            Onaccept routine for case event types:
            - only one type can be the default

            @param form: the FORM
        """

        form_vars = form.vars
        try:
            record_id = form_vars.id
        except __HOLE__:
            record_id = None
        if not record_id:
            return

        # If this type is the default, then set is_default-flag
        # for all other types to False:
        if "is_default" in form_vars and form_vars.is_default:
            table = current.s3db.dvr_case_event_type
            db = current.db
            db(table.id != record_id).update(is_default = False)

    # -------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/s3db/dvr.py/DVRCaseEventModel.case_event_type_onaccept