def handle(self, *args, **options): queryset = models.Currency.objects.no_cache().all() if not options['all']: queryset = queryset.order_by('last_update')[:options['num']] for currency in queryset: if options['verbosity']>1: self.stdout.write(u"updating %s\n"%currency.code) models.update_rate(currency)
def update_rate(self, request, queryset): for currency in queryset: models.update_rate(currency)