예제 #1
0
    def handle(self, **options):
        stats.invalidate_all()

        drinks = models.Drink.objects.all().order_by('id')
        num_drinks = len(drinks)
        pos = 0
        for d in drinks:
            pos += 1
            progbar('regenerating stats', pos, num_drinks)
            stats.generate(d, invalidate_first=False)

        print ''
        print 'done!'
예제 #2
0
    def handle(self, **options):
        stats.invalidate_all()

        drinks = models.Drink.objects.all().order_by('id')
        num_drinks = len(drinks)
        pos = 0
        for d in drinks:
            pos += 1
            progbar('regenerating stats', pos, num_drinks)
            stats.generate(d, invalidate_first=False)

        print ''
        print 'done!'
예제 #3
0
    def handle(self, *args, **options):
        num_drinks = models.Drink.objects.all().count()
        self.pos = 0

        def cb(results, self=self):
            self.pos += 1
            progbar("regenerating stats", self.pos, num_drinks)

        stats.invalidate_all()
        stats.rebuild_from_id(0, cb=cb)

        print("")
        print("done!")
예제 #4
0
    def handle(self, **options):

        num_drinks = models.Drink.objects.all().count()
        self.pos = 0

        def cb(results, self=self):
            self.pos += 1
            progbar('regenerating stats', self.pos, num_drinks)

        stats.invalidate_all()
        stats.rebuild_from_id(0, cb=cb)

        print ''
        print 'done!'