fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
scale initial mark with the image
[wolnelektury.git]
/
apps
/
catalogue
/
utils.py
diff --git
a/apps/catalogue/utils.py
b/apps/catalogue/utils.py
index
edc287f
..
33b0830
100644
(file)
--- a/
apps/catalogue/utils.py
+++ b/
apps/catalogue/utils.py
@@
-38,8
+38,12
@@
def get_random_hash(seed):
return urlsafe_b64encode(sha_digest).replace('=', '').replace('_', '-').lower()
return urlsafe_b64encode(sha_digest).replace('=', '').replace('_', '-').lower()
-def split_tags(tags):
- result = {}
+def split_tags(tags, initial=None):
+ if initial is None:
+ result = {}
+ else:
+ result = initial
+
for tag in tags:
result.setdefault(tag.category, []).append(tag)
return result
for tag in tags:
result.setdefault(tag.category, []).append(tag)
return result