示例#1
0
    def properties(self, gid, sid, did, scid, tid, cid):
        """
        Returns the Check Constraints property.

        Args:
            gid: Server Group Id
            sid: Server Id
            did: Database Id
            scid: Schema Id
            tid: Check Id
            cid: Check Constraint Id
        """

        status, res = check_utils.get_check_constraints(self.conn, tid, cid)
        if not status:
            return res

        if len(res) == 0:
            return gone(
                _("""Could not find the check constraint in the table."""))

        result = res
        if cid:
            result = res[0]

        return ajax_response(response=result, status=200)
示例#2
0
    def properties(self, gid, sid, did, scid, tid, cid):
        """
        Returns the Check Constraints property.

        Args:
            gid: Server Group Id
            sid: Server Id
            did: Database Id
            scid: Schema Id
            tid: Check Id
            cid: Check Constraint Id
        """

        status, res = check_utils.get_check_constraints(self.conn, tid, cid)
        if not status:
            return res

        if len(res) == 0:
            return gone(
                _("""Could not find the check constraint in the table."""))

        result = res
        if cid:
            result = res[0]
        result['is_sys_obj'] = (result['oid'] <= self._DATABASE_LAST_SYSTEM_OID
                                or self.datistemplate)

        return ajax_response(response=result, status=200)