本文整理汇总了Python中videos.models.SubtitleLanguage.subtitles_fetched_counter方法的典型用法代码示例。如果您正苦于以下问题:Python SubtitleLanguage.subtitles_fetched_counter方法的具体用法?Python SubtitleLanguage.subtitles_fetched_counter怎么用?Python SubtitleLanguage.subtitles_fetched_counter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类videos.models.SubtitleLanguage
的用法示例。
在下文中一共展示了SubtitleLanguage.subtitles_fetched_counter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: forwards
# 需要导入模块: from videos.models import SubtitleLanguage [as 别名]
# 或者: from videos.models.SubtitleLanguage import subtitles_fetched_counter [as 别名]
def forwards(self, orm):
if db.dry_run:
return
try:
from videos.models import Video, SubtitleLanguage
except ImportError:
return
try:
Video.widget_views_counter.r.ping()
except ConnectionError:
if settings.DEBUG:
return
raise Exception('Redis server is unavailable. You can ignore this migration with: python manage.py migrate videos 0068 --fake, but all statistic data will be lost.')
for obj in orm.Video.objects.all():
Video.subtitles_fetched_counter(obj.video_id).val = obj.subtitles_fetched_count
Video.widget_views_counter(obj.video_id).val = obj.widget_views_count
for obj in orm.SubtitleLanguage.objects.all():
SubtitleLanguage.subtitles_fetched_counter(obj.pk).val = obj.subtitles_fetched_count