0
我有一个表中卡桑德拉像:插入卡桑德拉蟒列表
CREATE TABLE IF NOT EXISTS article(
url text PRIMARY KEY,
title text,
author text,
sources list<text>)
我有一个对象Article
用下面的方法来将数据插入到卡桑德拉:
def save_to_cassandra(self, session):
session.execute(
"""
INSERT INTO article (url, title, author, sources)
VALUES (%s, %s, %s, ????)
""",
(self.url, self.title, self.author, ["http://source1.com", "http://source2.com"])
)
问题是我应该使用什么来代替????
来正确格式化字符串