所以我有下面的Feeds类
class Feeds(DeclarativeBase):
__tablename__ = "rawFeeds"
id = Column(Integer, primary_key=True)
link = Column('link', String)
date = Column('date', String)
source = Column('source', String)
def __init__(self, link, date, source):
self.link = link
self.date = date
self.source = source
我想运行一个检查表中是否已经存在数据(以避免添加重复项)。我使用下面的语句,但无论我尝试什么,它总是产生一个真实的结果
^{pr2}$谁能帮我弄清楚我做错了什么吗?我反复阅读了SQLAlchemy文档,但是我不知道这里的错误是什么。谢谢。在
在会话.查询()根据文档返回查询对象:
http://docs.sqlalchemy.org/en/rel_0_7/orm/query.html
这意味着if语句的计算结果始终为true。在
相关问题 更多 >
编程相关推荐