Re: [CPyUG:38922] Django的orm有 问题?
"清风" <[email protected]> Wed, 23 Jan 2008 11:30:06 +0800
| Newsgroups | gmane.comp.python.chinese |
|---|---|
| Message-ID | <[email protected]> |
代码运行时是否正确加载了项目的settings.py? 2008/1/22 Arui Zen <[email protected]>: > 情况如下: > 我的程序是一个server网关,需要7X24的跑,这里面用到如下一个函数: > > def get_CustomerNo(slef,imr_jid,cs_name): > dbopt_logger.debug("--- get_CustomerNo begin ---") > dbopt_logger.debug(imr_jid) > dbopt_logger.debug(cs_name) > try: > result = cSs.objects.filter(imr= > IMR.objects.get(jid=imr_jid).imrID,cs_name=cs_name)[0].customerNo > except Exception,value: > dbopt_logger.error("*** get_CustomerNo error ,value is %s" % > value ) > dbopt_logger.error("--- get_CustomerNo end ---") > return result > > 在shell下(python manage.py shell)运行,没有问题,比如imr_jid用hoho.testcom.com > cs_name用 [email protected] > > 得到的result是2L > > 而且无论运行几次都是一样的结果,不回抛异常. > > 怪异的是,无论白天测试人员如何折腾这个程序,都不会有问题,就是如果一晚上不动它,第二天早上一来肯定走到这里就死掉! > 输出的异常如下: > > "*** get_CustomerNo error ,value is (0,'') > 这是为啥? > Django的ORM是不是有问题啊? > Django的版本是: 0.97 pre > > 请帮忙分析一下. > > -- > > DJ > --~--~---------~--~----~------------~-------~--~----~ > '''邮件来自Groups "python-cn"--China Py User Group > 详情: http://groups-beta.google.com/group/python-cn > 发言: [email protected] > 退订: [email protected] > 维基: http://wiki.woodpecker.org.cn/moin/CPUG > 珠江事务: http://groups.google.com/group/zpug > 东南事务: http://groups.google.com/group/cpug-eastchina > 北京事务: http://groups.google.com/group/bpug > 中国事务: http://groups.google.com/group/CPUG > 同质列表: http://python.cn/mailman/listinfo/python-chinese > ''' > -~----------~----~----~----~------~----~------~--~--- > > -- http://qingfeng.ushared.com/blog/ _______________________________________________ python-chinese Post: send [email protected] Subscribe: send subscribe to [email protected] Unsubscribe: send unsubscribe to [email protected] Detail Info: http://python.cn/mailman/listinfo/python-chinese