fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
active menu item for picture page
[wolnelektury.git]
/
src
/
catalogue
/
utils.py
diff --git
a/src/catalogue/utils.py
b/src/catalogue/utils.py
index
e79b439
..
e94c67d
100644
(file)
--- a/
src/catalogue/utils.py
+++ b/
src/catalogue/utils.py
@@
-4,6
+4,7
@@
#
from collections import defaultdict
import hashlib
#
from collections import defaultdict
import hashlib
+import os.path
import random
import re
import time
import random
import re
import time
@@
-345,3
+346,11
@@
class AppSettings(object):
def delete_from_cache_by_language(cache, key_template):
cache.delete_many([key_template % lc for lc, ln in settings.LANGUAGES])
def delete_from_cache_by_language(cache, key_template):
cache.delete_many([key_template % lc for lc, ln in settings.LANGUAGES])
+
+
+def gallery_path(slug):
+ return os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR, slug)
+
+
+def gallery_url(slug):
+ return '%s%s%s/' % (settings.MEDIA_URL, settings.IMAGE_DIR, slug)