-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
I have two related models in Django models by a foreignkey. A post model and a comment model. They would look like:
```
from stream_django.activity import Activity
class UserPost(models.Model, Activity):
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='userPost')
title = models.CharField(max_length=30)
content = models.CharField(max_length=300)
created_at = models.DateTimeField(auto_now_add=True)
/the userpost comment would look something like:
class PostComment(models.Model, Activity):
post = models.ForeignKey(UserPost, on_delete=models.CASCADE, related_name='postcomment')
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='post_comment_user')
comment = models.TextField(max_length=1000, blank=True, null=True)
created_at = models.DateTimeField(auto_now_add=True)
.
I can template either the UserPost or just the PostComment Activity but somehow can't find a way to template both in a way that they can can reference each other. Sort of PostComment right under the UserPost it references. Any help with this?
Metadata
Metadata
Assignees
Labels
No labels