I want to get data about a Student which is currently logged in
Here is my code:
def profile(request):
cursor = connection.cursor()
a = request.user.id
cursor.execute("SELECT * from Student WHERE ID = a ")
data = dictfetchall(cursor)
return render(request, 'personal.html', {'data': data})
in table Student attribute ID is connected with attribute id in tha table auth_user Is it even possible to check? I know that with ORM it is easy to do, but I need to use raw sql