R
R
R.2017-07-20 17:05:41
Django
R., 2017-07-20 17:05:41

Python, Django: How to merge two datasets into one variable?

There are 2 data sets that need to be combined into one variable, then to be passed to the template. How can this be done?
Thanks in advance for your reply

user = User.objects.get(id=user_id)
user_info = UserInfo.objects.get(user_id=user_id)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2017-07-20
@ron6500

return render(request, 'template.html', {'user': user, 'user_info': user_info})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question