From 60a93ffd5a9aa7abb0a4f09c5de4374b77b2cae8 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Mon, 11 Aug 2014 17:57:33 +0530 Subject: added changes to submit codes directly for a book & to overwrite the previous data for sample notebooks --- tbc/admin.py | 1 + tbc/models.py | 3 ++ tbc/templates/base.html | 20 +++++++++++- tbc/templates/tbc/review-proposal.html | 8 ++--- tbc/templates/tbc/submit-sample.html | 27 ++++++++++----- tbc/templates/tbc/upload-content.html | 8 ++++- tbc/urls.py | 3 +- tbc/views.py | 60 ++++++++++++++++++++++++---------- 8 files changed, 97 insertions(+), 33 deletions(-) diff --git a/tbc/admin.py b/tbc/admin.py index 2a82b76..9983e27 100644 --- a/tbc/admin.py +++ b/tbc/admin.py @@ -8,3 +8,4 @@ admin.site.register(Chapters) admin.site.register(ScreenShots) admin.site.register(TempBook) admin.site.register(Proposal) +admin.site.register(SampleNotebook) diff --git a/tbc/models.py b/tbc/models.py index a1f2408..4b474f2 100644 --- a/tbc/models.py +++ b/tbc/models.py @@ -146,3 +146,6 @@ class SampleNotebook(models.Model): proposal = models.ForeignKey(Proposal) name = models.CharField(max_length=40) sample_notebook = models.FileField(upload_to=get_sample_dir) + def __unicode__(self): + notebook = self.proposal.accepted.title or 'notebook' + return '%s'%(notebook) diff --git a/tbc/templates/base.html b/tbc/templates/base.html index 91e8454..9708a53 100755 --- a/tbc/templates/base.html +++ b/tbc/templates/base.html @@ -94,7 +94,7 @@