def photo_count(self, public=True):
        if public:
            return self.public().count()
        else:
            return self.photos.filter(sites__id=settings.SITE_ID).count()
Compare Messages, taking into account plural ids
dataset/ETHPy150Open jdriscoll/django-photologue/photologue/models.py/Gallery.photo_count--crossover with--dataset/ETHPy150Open jbalogh/glow/vendor/lib/python/babel/messages/catalog.py/Message.__cmp__