123456789101112131415161718192021222324252627 |
- # -*- coding: utf-8 -*-
- #!/usr/bin/env python
- import os
- import sys
- import hashlib
- # : current_dir - 2
- PROJECT_ROOT = os.path.join(os.path.abspath(os.path.split(os.path.realpath(__file__))[0] + "/.."), '..')
- sys.path.insert(0, PROJECT_ROOT)
- from script.base import init_env
- init_env(interactive = True)
- from apps.web.ad.models import Advertisement
- ads = Advertisement.objects.all()
- for ad in ads:
- if ad.PIN == '1234':
- ad.PIN = '1234'
- ad.offlineFansNumber = 400
- ad.password = hashlib.md5('1234').hexdigest()
- ad.username = str(ad.adId)
- ad.save()
- print 'execute ok'
|