32 |
32 |
33 |
33 |
34 class Comment(soc.models.linkable.Linkable): |
34 class Comment(soc.models.linkable.Linkable): |
35 """Model of a comment on a work. |
35 """Model of a comment on a work. |
36 |
36 |
37 A comment is associated with a Work, for example a Document or a Proposal, |
37 A comment is usually associated with a Work or a Proposal, |
38 and with a user, the author. There are two types of comment, public (i.e. |
38 for example a Document or a Student Proposal, and with a user, the author. |
39 visible to the student), or private (i.e. visible to programme/club staff). |
39 There are two types of comment, public (i.e. visible to the student), |
40 Neither type are visible to people who are not connected to the work being |
40 or private (i.e. visible to programme/club staff). Neither type are |
41 commented on. |
41 visible to people who are not connected to the work being commented on. |
42 """ |
42 """ |
43 |
43 |
44 #: A required many:1 relationship with a comment entity indicating |
44 #: A required many:1 relationship with a comment entity indicating |
45 #: the user who provided that comment. There is a backreference in Work |
45 #: the user who provided that comment. |
46 #: called comments, which is a db.Query instance. |
|
47 author = db.ReferenceProperty(reference_class=soc.models.user.User, |
46 author = db.ReferenceProperty(reference_class=soc.models.user.User, |
48 required=True, collection_name="commented") |
47 required=True, collection_name="commented") |
49 |
48 |
50 #: The rich textual content of this comment |
49 #: The rich textual content of this comment |
51 content = db.TextProperty(verbose_name=_('Content')) |
50 content = db.TextProperty(verbose_name=_('Content')) |