def _update_member_about_video(member,video,names): result_video=None if _validate_dict(video,[ 'title','embed_url_autoplay','thumbnail480x360', 'id','description','link','published' ]): title=video['title'] if ( u'כרטיס ביקור' in title and u'ערוץ הכנסת' in title ): for name in names: if name in title: result_video=video break if result_video is None: return False else: v = Video( embed_link=result_video['embed_url_autoplay'], image_link=result_video['thumbnail480x360'], title=result_video['title'], description=result_video['description'], link=result_video['link'], source_type='youtube', source_id=result_video['id'], published=result_video['published'], group='about', content_object=member ) v.save() return True
def _update_member_related_video(member,video): cnt=get_videos_queryset(member).filter(source_id=video['id'],source_type='youtube').count() if cnt==0: v = Video( embed_link=video['embed_url_autoplay'], small_image_link=video['thumbnail90x120'], title=video['title'], description=video['description'], link=video['link'], source_type='youtube', source_id=video['id'], published=video['published'], group='related', content_object=member ) v.save() return True else: return False
def _saveVideo(self, videoFields): v = Video(**videoFields) v.save()
def _saveVideo(self,videoFields): v=Video(**videoFields) v.save()
def _saveVideo(self, videoFields): video = Video(**videoFields) video.save() return video
def _saveVideo(self,videoFields): video=Video(**videoFields) video.save() return video