0
我有一個新聞源的動作模型。像這樣:如何在同一日期顯示創建的操作?
class Action(models.Model):
actor = models.ForeignKey(User)
target_object_id = models.PositiveIntegerField()
target_content_type= models.ForeignKey(
ContentType,
related_name='target'
)
target = generic.GenericForeignKey(
'target_content_type',
'target_object_id'
)
verb = models.CharField(max_length=200)
date = models.DateTimeField(default=datetime.now())
def __unicode__(self):
return "{0} {1}".format(
self.actor,
self.verb,
)
我想通過今天創建一個來顯示一個行動。布我想要顯示這樣的舊操作:
22.12.2013 - 2 posts created for A Blog
22.12.2013 - x followed 3 people
21.12.2013 - 3 posts created for B Blog
21.12.2013 - 4 channel created
這是用戶的新聞源。我怎麼能根據日期做到這一點?
你能發表您的看法? – niekas