def increase_counter(self, field, count=1):
        counter_field = '%s_count' % field
        counter_value = getattr(self, counter_field, 0) + count
        if counter_value <= 0:
            counter_value = 0

        attributes = dict([(counter_field, counter_value)])
        self.update(**attributes)
dataset/ETHPy150Open DoubleCiti/daimaduan.com/daimaduan/models/__init__.py/BaseDocument.increase_counter/original