Test for parenthood by looking for children instead of HTML.
[wolnelektury.git] / apps / reporting / templatetags / reporting_stats.py
index 6f20c08..ee9a7bf 100755 (executable)
@@ -50,11 +50,11 @@ def count_books_all():
 
 @register_counter
 def count_books():
-    return Book.objects.exclude(html_file='').count()
+    return Book.objects.filter(children=None).count()
 
 @register_counter
 def count_books_parent():
-    return Book.objects.filter(html_file='').count()
+    return Book.objects.exclude(children=None).count()
 
 @register_counter
 def count_books_root():