示例#1
0
    def properties(self, gid, sid, did, scid, tid, fkid=None):
        """
        This function is used to list all the foreign key
        nodes within that collection.

        Args:
          gid: Server Group ID
          sid: Server ID
          did: Database ID
          scid: Schema ID
          tid: Table ID
          fkid: Foreign key constraint ID

        Returns:

        """
        status, res = fkey_utils.get_foreign_keys(self.conn, tid, fkid)
        if not status:
            return res

        if len(res) == 0:
            return gone(gettext(FOREIGN_KEY_NOT_FOUND))

        result = res
        if fkid:
            result = res[0]
        result['is_sys_obj'] = (result['oid'] <= self.datlastsysoid)

        return ajax_response(response=result, status=200)
示例#2
0
    def properties(self, gid, sid, did, scid, tid, fkid=None):
        """
        This function is used to list all the foreign key
        nodes within that collection.

        Args:
          gid: Server Group ID
          sid: Server ID
          did: Database ID
          scid: Schema ID
          tid: Table ID
          fkid: Foreign key constraint ID

        Returns:

        """
        status, res = fkey_utils.get_foreign_keys(self.conn, tid, fkid)
        if not status:
            return res

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

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

        return ajax_response(response=result, status=200)