利用dogpi缓存sqlalchemy模型中的列\u属性

2024-09-26 04:50:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我想知道是否有机会使用dogpile缓存column_property。你知道吗

这是我的密码:

A.some_count = column_property(
  select([func.count()])
    .where(and_(B.__table__.c.a_id == A.__table__.c.id,
                B.__table__.c.c_id == C.__table__.c.id))  
    .correlate(A.__table__, C.__table__)
    .as_scalar()
    .label('some_count'),
  deferred=True)

有人知道怎么做吗?任何类型的缓存都可以使用时间戳或无效。你知道吗

谢谢你的帮助。你知道吗


Tags: andid密码ascounttablecolumnproperty