当前位置: 首页>>代码示例>>Python>>正文


Python Client.get_activity_photos方法代码示例

本文整理汇总了Python中stravalib.client.Client.get_activity_photos方法的典型用法代码示例。如果您正苦于以下问题:Python Client.get_activity_photos方法的具体用法?Python Client.get_activity_photos怎么用?Python Client.get_activity_photos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在stravalib.client.Client的用法示例。


在下文中一共展示了Client.get_activity_photos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_activity_photos

# 需要导入模块: from stravalib.client import Client [as 别名]
# 或者: from stravalib.client.Client import get_activity_photos [as 别名]
def get_activity_photos(passed_client=None, passed_activity_id=None):
    return
    if passed_client:
        client = passed_client
    else:
        client = Client()
    if passed_activity_id:
        if not picture.objects.filter(activity_id=passed_activity_id):
            photos = client.get_activity_photos(passed_activity_id)
    else:
        for each_activity in activity.objects.all():
            if not picture.objects.filter(activity_id=each_activity):
                photos = client.get_activity_photos(each_activity.id)
    photos = list(photos)
    print(photos)
    for each_photo in photos:
        print(each_photo)
        if not picture.objects.filter(activity_id=activity(pk=each_photo.activity_id)):
            for each_url in each_photo.urls:
                new_photo = picture(url=each_url, activity_id=activity(pk=each_photo.activity_id))
                new_photo.save()
开发者ID:wmorrill,项目名称:elevation,代码行数:23,代码来源:apps.py


注:本文中的stravalib.client.Client.get_activity_photos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。