# -*- coding: utf-8 -*- # !/usr/bin/env python import os,sys PROJECT_ROOT = os.path.join(os.path.abspath(os.path.split(os.path.realpath(__file__))[0] + "/.."), '..') sys.path.insert(0, PROJECT_ROOT) os.environ.update({"DJANGO_SETTINGS_MODULE": "configs.production"}) import django django.setup() from apps.web.dealer.models import Dealer blackList = ['13394586789 ','17758719757','17689963671','13799218960 '] dealers = Dealer.objects.filter(agentId = '6417d4456f29257125ebf705',forceFollowGzh__ne = 'yes') count = 0 for dealer in dealers[0:20000]: if dealer.username in blackList: continue Dealer.update_dealer(dealer.id,forceFollowGzh = 'yes') count += 1 if count % 100 == 0: print 'finished num',count print 'finished'