4504b6fe1fe62c50e8a43b1c06ea098a7ab252cc
[zzz-floof.git] / floof / model / comments.py
1 import datetime
2
3 from elixir import *
4
5 class Discussion(Entity):
6 """Represents a collection of comments attached to some other object."""
7 count = Field(Integer)
8 comments = OneToMany('Comment')
9
10 class Comment(Entity):
11 time = Field(DateTime, default=datetime.datetime.now)
12 text = Field(Unicode(65536))
13
14 discussion = ManyToOne('Discussion')
15 user = ManyToOne('User')