Chen Yangjian's Blog

Carpe diem - Seize the day

Google App Engine 的一个 Gotcha

| Comments

python 版

比如说 Blog,按照教程,一般的做法是,有个 db.Model 叫做 Blog,同时,还得有个 webapp.RequestHander,如果在把它也叫做 Blog 的话,python 是不会报重名的错误的,Google App Engine 也不会报。

结果通常是:

AttributeError: 'module' object has no attribute '_unindexed_properties'

或者

AttributeError: 'PaypalIPN' object has no attribute 'response'

之类的错误信息。

解决方式么,其实可以猥琐一下;或者还是别勉强了,class 名字起得有深度一点,对彼此都是一种解脱……

Comments