diff options
author | hardythe1 | 2014-03-12 18:10:14 +0530 |
---|---|---|
committer | hardythe1 | 2014-03-12 18:10:14 +0530 |
commit | 13c23a55b2ac453d4a41405eaa5f1da491173e41 (patch) | |
tree | 6cc97baa2dbb065d2e6c100ba533324aa4c1aab6 /tbc | |
parent | fd5ed8a1c346243b44cadb3217491515bd9e65cd (diff) | |
download | Python-TBC-Interface-13c23a55b2ac453d4a41405eaa5f1da491173e41.tar.gz Python-TBC-Interface-13c23a55b2ac453d4a41405eaa5f1da491173e41.tar.bz2 Python-TBC-Interface-13c23a55b2ac453d4a41405eaa5f1da491173e41.zip |
Replacing spaces with undersocres while storing books
Diffstat (limited to 'tbc')
-rw-r--r-- | tbc/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tbc/models.py b/tbc/models.py index f334579..e663ec0 100644 --- a/tbc/models.py +++ b/tbc/models.py @@ -39,11 +39,11 @@ ABOUT_PROJ = (("pythontbc website", "Python TBC Website"), ("others", "Others")) def get_notebook_dir(instance, filename): - return '%s/%s/%s' % (instance.book.contributor, instance.book.title, filename) + return '%s/%s/%s' % (instance.book.contributor, instance.book.title.replace(' ', '_'), filename) def get_image_dir(instance, filename): - return '%s/%s/screenshots/%s' % (instance.book.contributor, instance.book.title, filename) + return '%s/%s/screenshots/%s' % (instance.book.contributor, instance.book.title.replace(' ', '_'), filename) class Profile(models.Model): |