upgrade_agent_trafficCardCost_20190122.py 586 B

123456789101112131415161718192021222324252627
  1. # -*- coding: utf-8 -*-
  2. # !/usr/bin/env python
  3. """
  4. """
  5. import os
  6. import sys
  7. from bson.decimal128 import Decimal128
  8. #: current_dir - 2
  9. PROJECT_ROOT = os.path.join(os.path.abspath(os.path.split(os.path.realpath(__file__))[0] + "/.."), '..')
  10. sys.path.insert(0, PROJECT_ROOT)
  11. from script.base import init_env, get_logger
  12. logger = get_logger(__name__)
  13. init_env(interactive=True)
  14. from apps.web.agent.models import Agent
  15. updated = Agent.objects(id='5b9cb1484864d011b02cd0f4').update(set__trafficCardCost=Decimal128('15'))
  16. print 'updated', updated, 'agentId=5b9cb1484864d011b02cd0f4'