diff options
author | Madhusudan.C.S | 2010-01-14 19:19:34 +0530 |
---|---|---|
committer | Madhusudan.C.S | 2010-01-14 19:19:34 +0530 |
commit | 2f7d4fef4fe3b4104d046bf22e860a114e7a2c01 (patch) | |
tree | 724637863671e36e05de329b0ce812d8ba073150 | |
parent | bcfeb961869c71e1bb8c2b0e8a5b15008f4b05c0 (diff) | |
download | scipycon-2f7d4fef4fe3b4104d046bf22e860a114e7a2c01.tar.gz scipycon-2f7d4fef4fe3b4104d046bf22e860a114e7a2c01.tar.bz2 scipycon-2f7d4fef4fe3b4104d046bf22e860a114e7a2c01.zip |
Added two models, Paper and Attachments.
-rw-r--r-- | project/kiwipycon/proceedings/models.py | 19 | ||||
-rw-r--r-- | project/kiwipycon/proceedings/views.py | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/project/kiwipycon/proceedings/models.py b/project/kiwipycon/proceedings/models.py index e63dff6..5a76503 100644 --- a/project/kiwipycon/proceedings/models.py +++ b/project/kiwipycon/proceedings/models.py @@ -9,6 +9,25 @@ class Paper(models.Model): """Data model for storing proceedings paper. """ + # Title of the paper title = models.CharField(max_length=200) + + # Abstract to be published with the paper abstract = models.TextField() + + # Body text of the paper body = models.TextField() + + # Authors + authors = models.ManyToManyField(User) + + +class Attachments(models.Model): + """Stores attachments for papers. + """ + + # Attachment for generating paper + attachments = models.FileField(upload_to='attachments/%Y/%m/%d') + + # The paper to which this attachment belongs to + paper = models.ForeignKey(Paper) diff --git a/project/kiwipycon/proceedings/views.py b/project/kiwipycon/proceedings/views.py index 3680873..d51a107 100644 --- a/project/kiwipycon/proceedings/views.py +++ b/project/kiwipycon/proceedings/views.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +from django.contrib.auth import login from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm from django.shortcuts import render_to_response @@ -33,7 +34,6 @@ def submit(request, template = 'proceedings/submit.html'): login_form = AuthenticationForm(data=request.POST) if login_form.is_valid(): - from django.contrib.auth import login login(request, login_form.get_user()) redirect_to = reverse('kiwipycon_submit_proceedings') |