How to choose a specific review on the page?

Now make the button of likes on the comments in the article.

Situation:

Model articles - it is attached via a ForeignKey model with comments.

In view that everything is displayed like this:

def video(request, video_id):
 videoitem = Video.objects.get(id = video_id) #the content of the article
 comview = Video_com.objects.filter(video_link_id=video_id) #comments to the article are displayed on the page through the loop

context = {
 "videoitem" : videoitem, 
 "comview" : comview, 
}
 return render(request, 'faceset/videopage.html', context)


the url for adding likes to comments

url(r'^upvideocomlike(?P<add_id>[0-9]+)$', views.upvideocomlike, name='upvideocomlike'),
 url(r'^downvideocomlike(?P<add_id>[0-9]+)$', views.downvideocomlike, name='downvideocomlike'),</add_id></add_id>


And I want to put in a comment link on the huskies about as {% 'upvideocomlike' add_id %}, but I do not understand how to select a particular comment in a particular article? Because in the url you need to convey and the current number of articles and number to a specific review.

I can tell the logic, I flowed.
July 8th 19 at 12:03
1 answer
July 8th 19 at 12:05
Solution

example:
there is a video.id = 1, two commentaries (id=1, id=2),
there is a video.id = 2, three commentaries (id=3, id=4, id=5).
You just pass in only the id of the comment, maybe all comments are stored in one table and they can not be the same id regardless of which videos they are
The documentation Jangi there are examples of how through one model to get the data from the dependent models. In General, all this is achieved. - Shanie_Armstrong98 commented on July 8th 19 at 12:08

Find more questions by tags DjangoPython