Re: AttributeError when returning post.title in a comment model

2020-05-31 Thread Julio Cojom
Try '{0}-{1}'.format(var1, var2) Check in the console in what line it's throwing the attribute error Rewards El vie., 29 de mayo de 2020 5:10 p. m., Ahmed Khairy < ahmed.heshamel...@gmail.com> escribió: > I was working on a comment section for post and was getting an > AttributeError when I ret

AttributeError when returning post.title in a comment model

2020-05-29 Thread Ahmed Khairy
I was working on a comment section for post and was getting an AttributeError when I return return '{}-{}'.format(self.post.title, str(self.user.username)) in the comment model I am trying to link users and posts to the comment I am getting the same error Here is the Models.py class Comment