""" open/dulcinea/lib/comment.py """ from dulcinea.base import DulcineaPersistent from dulcinea.timestamped import Timestamped from dulcinea.user import DulcineaUser from qp.lib.spec import specify, add_getters, spec, string class Comment(DulcineaPersistent, Timestamped): text_is = spec( string) user_is = spec( (None, DulcineaUser), "The author of the comment") def __init__(self, text, user): Timestamped.__init__(self) specify(self, text=text, user=user) def __str__(self): return "%s at %s" % (self.user, self.get_timestamp()) add_getters(Comment)