示例#1
0
 def populate_fake_tweets(self):
     Tweet.objects.all().delete()
     for profile in Profile.objects.all():
         for t in "1234567":
             tweet = Tweet(author=profile, text=str(t))
             tweet.save()
             print "Fake Tweet '" + str(tweet.text) + "' by '" + str(profile.username) + "' Created!!!"
示例#2
0
 def populate_fake_tag_tweets(self):
     for profile in Profile.objects.all():
         for t in "890":
             tweet = Tweet(author=profile, text=str(t))
             tweet.save()
             tweet.tags.add(Profile.objects.all()[random.randint(0, 9)])
             print "Fake Tweet '" + str(tweet.text) + "' by '" + str(profile.username) + "' with '" + str(
                 tweet.tags.get_queryset()[0].username) + "' Created!!!"