Hi group, Does anybody have a suggestion for this problem? I am trying to make a matchmodel between the same field in two lists, item_one and item_two. Item is one of the Charfields in a Post. The Post is attached with a foreign key to a blog (blog__id=1 or blog__id=2).
So if in item list one the Post.item[id] == item list two Post.item [id] get the id and generate a list. My thought were grossly this (not right syntax): def match(request, username=None, template_name="blog/ match.html"): for item in Post.objects.all(): item_one = Post.objects.filter(blog__id=1) item_two = Post.objects.filter(blog__id=2) for item in item_one() and for item in item_two(): if item_one == item_one: match_id = Post.objects.get(pk=id) Post.objects.filter(match_id) return HttpResponseRedirect(reverse("list_match_id")) Otherwise i tried to use this: item1 = Post.objects.values_list('item').select_related().get (blog__id=1) item2 = Post.objects.values_list('item').select_related().get (blog__id=2) Though this method is unable to handle more than 1 value. Any ideas? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.