summaryrefslogtreecommitdiff
path: root/website/models.py
blob: 93102206479d39ae33d5bf3e53d951932ebd729c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from django.db import models
from django.contrib.auth.models import User

def get_document_dir(instance, filename):
    return '%s/document/%s' % (instance.user, filename)

def get_presentation_dir(instance, filename):
    return '%s/presentation/%s' % (instance.user, filename)

class Paper(models.Model):
    user = models.ForeignKey(User)
    title = models.CharField(max_length=250)
    affiliation = models.CharField(max_length=250)
    objective = models.CharField(max_length=512)
    abstract = models.TextField(max_length=700)
    bio = models.TextField(max_length=500)
    links = models.CharField(max_length=128)
    attachments = models.FileField(upload_to=get_document_dir)
    verified = models.NullBooleanField()
    talk_type = models.NullBooleanField()

class Comment(models.Model):
    paper = models.ForeignKey(Paper)
    comment_by = models.ForeignKey(User)
    comment = models.CharField(max_length=500)