Test for parenthood by looking for children instead of HTML.
[wolnelektury.git] / apps / reporting / templatetags / reporting_stats.py
index dceee00..ee9a7bf 100755 (executable)
@@ -49,12 +49,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():