diff options
author | hardythe1 | 2014-03-13 15:33:51 +0530 |
---|---|---|
committer | hardythe1 | 2014-03-13 15:33:51 +0530 |
commit | 44f187cd9a1f47df1e526dacc634838dc7485abb (patch) | |
tree | 30ec947bc18a4b96ae5c8b7646b5211856c258f9 /tbc | |
parent | 6191d17041db1e1bebd5406b22ee4d9f4fd7e6ec (diff) | |
download | Python-TBC-Interface-44f187cd9a1f47df1e526dacc634838dc7485abb.tar.gz Python-TBC-Interface-44f187cd9a1f47df1e526dacc634838dc7485abb.tar.bz2 Python-TBC-Interface-44f187cd9a1f47df1e526dacc634838dc7485abb.zip |
replacing spaces with underscores in filenames
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 e663ec0..4465a4d 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.replace(' ', '_'), filename) + return '%s/%s/%s' % (instance.book.contributor, instance.book.title.replace(' ', '_'), filename.replace(' ', '_')) def get_image_dir(instance, filename): - return '%s/%s/screenshots/%s' % (instance.book.contributor, instance.book.title.replace(' ', '_'), filename) + return '%s/%s/screenshots/%s' % (instance.book.contributor, instance.book.title.replace(' ', '_'), filename.replace(' ', '_')) class Profile(models.Model): |