1for i in range(1,10):
2 obj = Count.objects.filter(userId=request.user.id, channelId=cid)
3 if not obj:
4 news_obj = News_Channel.objects.get(id=i)
5 o = Count.objects.create(id=Count.objects.all().count() + 1,userId=request.user.id, channelId=news_obj,rate=0)
6 o.save()
7 i += 1