# HG changeset patch # User Madhusudan.C.S # Date 1263476974 -19800 # Node ID 1ec579a679e452fc8e502ab2cd1970fede2c8a39 # Parent cbe77a26e7a3dd418b81b2e694776e4eb8c94f39 Added two models, Paper and Attachments. diff -r cbe77a26e7a3 -r 1ec579a679e4 project/kiwipycon/proceedings/models.py --- a/project/kiwipycon/proceedings/models.py Thu Jan 14 19:19:12 2010 +0530 +++ b/project/kiwipycon/proceedings/models.py Thu Jan 14 19:19:34 2010 +0530 @@ -9,6 +9,25 @@ """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 -r cbe77a26e7a3 -r 1ec579a679e4 project/kiwipycon/proceedings/views.py --- a/project/kiwipycon/proceedings/views.py Thu Jan 14 19:19:12 2010 +0530 +++ b/project/kiwipycon/proceedings/views.py Thu Jan 14 19:19:34 2010 +0530 @@ -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 @@ 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')