model.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:DublinBikeApp 作者: charlawl 项目源码 文件源码
def get_current_station_info(cls, dbsession):
        """as the method name suggests this returns the up to date station information."""
        sub = dbsession.query(UsageData.station_id, func.max(UsageData.id).label('max_update')).group_by(
            UsageData.station_id).subquery()
        return dbsession.query(
            UsageData.last_update,
             UsageData.available_bike_stands, UsageData.available_bikes).join(sub, and_(
                sub.c.max_update == UsageData.id)).all()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号