1
# -*- coding: utf-8 -*-
3
from django.db import models
5
# Create your models here.
7
class Paper(models.Model):
8
title = models.CharField(max_length=255)
9
text = models.TextField()
10
author = models.CharField(max_length=255)
11
def __unicode__(self):
12
return u"«" + self.title + u"» by " + self.author
14
class Comment(models.Model):
15
paper = models.ForeignKey(Paper)
16
text = models.TextField()
17
author = models.CharField(max_length=255)
18
date = models.DateTimeField(auto_now=True)
19
def __unicode__(self):
20
return u"Comment on «" + self.paper.title + u"» by " + self.author + " at " + str(self.date)