fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Librarian with fixed epub thank-you note
[wolnelektury.git]
/
apps
/
catalogue
/
models
/
book.py
diff --git
a/apps/catalogue/models/book.py
b/apps/catalogue/models/book.py
index
eab6b2d
..
d69cf2a
100644
(file)
--- a/
apps/catalogue/models/book.py
+++ b/
apps/catalogue/models/book.py
@@
-75,7
+75,7
@@
class Book(models.Model):
self.sort_key = sortify(self.title)
self.sort_key = sortify(self.title)
- ret = super(Book, self).save(force_insert, force_update)
+ ret = super(Book, self).save(force_insert, force_update
, **kwargs
)
if reset_short_html:
self.reset_short_html()
if reset_short_html:
self.reset_short_html()
@@
-511,10
+511,11
@@
class Book(models.Model):
"""
# get relevant books and their tags
objects = cls.tagged.with_all(tags)
"""
# get relevant books and their tags
objects = cls.tagged.with_all(tags)
+ parents = objects.filter(html_file='').only('slug')
# eliminate descendants
l_tags = Tag.objects.filter(category='book',
# eliminate descendants
l_tags = Tag.objects.filter(category='book',
- slug__in=[book.book_tag_slug() for book in
objec
ts.iterator()])
- descendants_keys = [book.pk for book in cls.tagged.with_any(l_tags).iterator()]
+ slug__in=[book.book_tag_slug() for book in
paren
ts.iterator()])
+ descendants_keys = [book.pk for book in cls.tagged.with_any(l_tags).
only('pk').
iterator()]
if descendants_keys:
objects = objects.exclude(pk__in=descendants_keys)
if descendants_keys:
objects = objects.exclude(pk__in=descendants_keys)
@@
-560,6
+561,7
@@
class Book(models.Model):
return books_by_author, orphans, books_by_parent
_audiences_pl = {
return books_by_author, orphans, books_by_parent
_audiences_pl = {
+ "SP": (1, u"szkoła podstawowa"),
"SP1": (1, u"szkoła podstawowa"),
"SP2": (1, u"szkoła podstawowa"),
"P": (1, u"szkoła podstawowa"),
"SP1": (1, u"szkoła podstawowa"),
"SP2": (1, u"szkoła podstawowa"),
"P": (1, u"szkoła podstawowa"),
@@
-569,7
+571,7
@@
class Book(models.Model):
}
def audiences_pl(self):
audiences = self.extra_info.get('audiences', [])
}
def audiences_pl(self):
audiences = self.extra_info.get('audiences', [])
- audiences = sorted(set([self._audiences_pl
[a]
for a in audiences]))
+ audiences = sorted(set([self._audiences_pl
.get(a, (99, a))
for a in audiences]))
return [a[1] for a in audiences]
def choose_fragment(self):
return [a[1] for a in audiences]
def choose_fragment(self):