Guest User

Untitled

a guest
Jul 6th, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.07 KB | None | 0 0
  1. class Thread(Document):
  2.     creator = StringField(default='Anon')
  3.     number = IntField(unique=True)
  4.     subject = StringField()
  5.     content = StringField()
  6.     file = ImageField()
  7.     img_width = IntField()
  8.     img_height = IntField()
  9.     thumb_width = IntField()
  10.     thumb_height = IntField()
  11.     img_size = IntField()
  12.     reply = ListField(ReferenceField('Post'))
  13.     pub_date = DateTimeField(default=datetime.now())
  14.     bump_date = DateTimeField(default=datetime.now())
  15.     reply_count = IntField(default=0)
  16.     image_count = IntField(default=0)
  17.  
  18.     def __unicode__(self):
  19.         return self.subject
  20.  
  21.  
  22. class Post(Document):
  23.     creator = StringField(default='Anon')
  24.     number = IntField(unique=True)
  25.     content = StringField()
  26.     file = ImageField()
  27.     img_width = IntField()
  28.     img_height = IntField()
  29.     thumb_width = IntField()
  30.     thumb_height = IntField()
  31.     img_size = IntField()
  32.     pub_date = DateTimeField(default=datetime.now())
  33.     thread = ReferenceField(Thread, dbref = True)
  34.  
  35.     def __unicode__(self):
  36.         return self.content
Advertisement
Add Comment
Please, Sign In to add comment