1
Hello,
I’m creating a Blog system with Django, in it I have several Models: Profile(which receives an auth.User), Post(which has an Author field that receives a Profile). I am developing a page to perform the update of a Post, I know that the user.is_authenticated function checks if the user is connected, in my case how do I know if the user who is connected is the same as the Post
Follow the code in my template:
{% user.is_authenticated and user.id == post.user %}
......
{%endif%}
In case it would return me an Object Profile and not User, how do I know the User profile, it would be correct to use post.user.profile profile ?