Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def find_similars(request):
- posts = Post.objects.get()
- for post1 in posts:
- words = post1.body.split(' ')
- for post2 in posts:
- for i in range(len(words)):
- if word[i] in post2.body:
- post2.similars = post1.id
- post1.save()
- return HttpResponseRedirect(reverse('post1', kwargs={'post': post}))
Add Comment
Please, Sign In to add comment