本文整理汇总了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()