fix in librarian
[wolnelektury.git] / apps / reporting / templatetags / reporting_stats.py
index dceee00..7bbe23d 100755 (executable)
@@ -2,13 +2,9 @@
 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
 #
-import feedparser
 from functools import wraps
-import datetime
-
 from django import template
-
-from catalogue.models import Book, BookMedia
+from catalogue.models import Book
 
 
 register = template.Library()
@@ -49,12 +45,12 @@ def count_books_all():
     return Book.objects.all().count()
 
 @register_counter
-def count_books_nonempty():
-    return Book.objects.exclude(html_file='').count()
+def count_books():
+    return Book.objects.filter(children=None).count()
 
 @register_counter
-def count_books_empty():
-    return Book.objects.filter(html_file='').count()
+def count_books_parent():
+    return Book.objects.exclude(children=None).count()
 
 @register_counter
 def count_books_root():