How to get table data based on id which obtains from another table data? DjangoViews company = company.objects.get(id = company_id) # getting input from django urls