I am working on a django blog app and i want to access all the fields of database through foreign key of other database .
class User(AbstractUser):
about_user = models.TextField(("Profile"),blank = True)
def __str__(self):
return self.username
class Post(models.Model):
author = models.ForeignKey("account.User",on_delete=models.CASCADE)
status = models.BooleanField(("Status"),default = False)
Now I want to access all the data of user database from post something like
posts = Post.objects.filter(status = True)
posts.author.about_author
or
user = User.objects.filter(username = post.author)
user.about_author
what i am trying here in my template all the content of post will display and after that i want the about_author (whoever wrote the post ).kinda like how stackoverflow shows every questions.
Thanks in advance and any advice would be much appreciated.