+ # I shouldn't break the get_count() api
+ # just to include pictures.
+ def get_picture_count(self):
+ from picture.models import Picture, PictureArea
+
+ if self.category == 'book':
+ # never used
+ objects = Picture.objects.none()
+ elif self.category == 'theme':
+ objects = PictureArea.tagged.with_all((self,))
+ elif self.category == 'thing':
+ objects = Picture.tagged.with_all((self,))
+ else:
+ objects = Picture.tagged.with_all((self,)).order_by()
+ return objects.count()
+