使用应用django-activity-stream的人是否可以通过示例告诉我如何正确使用它?阅读完文档后,我真的很感激。
我需要显示我的模态Characterictic
中的最后10个活动。用户可以编辑Characterictic对象,也可以向对象添加注释。
例如:
1) User A add comment to Characterictic B in 11:45
2) User B edit Characterictic C in 11:00
3) User C create Characterictic А in 09:55.
models.py:
class Characteristic(models.Model):
project = models.ForeignKey(Project, on_delete=models.CASCADE)
symbol = models.CharField(_('Symbol'), max_length=250)
description = models.TextField(_('Description'))
comments = models.ManyToManyField("Comment")
create_time = models.DateTimeField(_('Date of creation'), auto_now_add=True)
revision_date = models.DateTimeField(_('Date of last update'), auto_now=True)
class Comment(models.Model):
author = models.ForeignKey(User, on_delete=models.CASCADE)
text = models.TextField()
created = models.DateTimeField(auto_now_add=True)