summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhardythe12015-06-01 14:55:36 +0530
committerhardythe12015-06-01 14:55:36 +0530
commitee4d8c4a88c837cd3d7959a8f345898db6131238 (patch)
treef2a1346ec94e27a8e9139ec0968ad18345d5ff85
parentce84d146d943057dc96fd1b687f2d07c3c1f0f84 (diff)
downloadPython-TBC-Interface-ee4d8c4a88c837cd3d7959a8f345898db6131238.tar.gz
Python-TBC-Interface-ee4d8c4a88c837cd3d7959a8f345898db6131238.tar.bz2
Python-TBC-Interface-ee4d8c4a88c837cd3d7959a8f345898db6131238.zip
Add author name to the book directory to avoid ambiguity for same book names
-rw-r--r--tbc/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tbc/models.py b/tbc/models.py
index ee8442f..e2e6940 100644
--- a/tbc/models.py
+++ b/tbc/models.py
@@ -57,7 +57,8 @@ BOOK_PREFERENCE = (("book1","1st Book"),
def get_notebook_dir(instance, filename):
- return '%s/%s' % (instance.book.title.replace(' ', '_'), filename.replace(' ', '_'))
+ book_dir = instance.book.title.replace(' ', '_')+'_by_'+instance.book.author.replace(' ','_')
+ return '%s/%s' % (book_dir, filename.replace(' ', '_'))
def get_image_dir(instance, filename):