fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f28c3c
)
Made short text fragment text shorter.
author
Marek Stępniowski
<marek@stepniowski.com>
Thu, 4 Sep 2008 20:32:20 +0000
(22:32 +0200)
committer
Marek Stępniowski
<marek@stepniowski.com>
Thu, 4 Sep 2008 20:32:20 +0000
(22:32 +0200)
catalogue/models.py
patch
|
blob
|
history
diff --git
a/catalogue/models.py
b/catalogue/models.py
index
e9c8928
..
c82cf43
100644
(file)
--- a/
catalogue/models.py
+++ b/
catalogue/models.py
@@
-163,8
+163,8
@@
class Book(models.Model):
for fragment in closed_fragments.values():
text = fragment.to_string()
short_text = ''
- if (len(re.sub(r'</?.*?>', '', text)) >
40
0):
- short_text = MarkupString(text)[:
24
0]
+ if (len(re.sub(r'</?.*?>', '', text)) >
24
0):
+ short_text = MarkupString(text)[:
16
0]
new_fragment = Fragment(text=text, short_text=short_text, anchor=fragment.id, book=book)
theme_names = [s.strip() for s in fragment.themes.split(',')]