class Message models Model src_user models ForeignKey User related_nam

1
2
3
4
5
6
7
8
9
class Message(models.Model):
src_user = models.ForeignKey(User,related_name='src_users',)
dst_user = models.ForeignKey(User,related_name='dst_users',)
dst_read = models.BooleanField(default=False)
src_delete = models.BooleanField(default=False)
dst_delete = models.BooleanField(default=False)
subject = models.CharField(maxlength=255)
content = models.TextField(maxlength=5000)
time = models.DateTimeField(default=datetime.now)