Tools/Python
[GAE in Python] TypeError: Error when calling the metaclass bases
B&U
2016. 9. 5. 23:54
GAE 에서 ndb.Model을 써보려고 하는데... 아래와 같은 에러가 나네요..
1. Code
class BeanAndYuDataModel(ndb.model): account = ndb.StructuredProperty(Account) data = ndb.StructuredProperty(Data)
createdTime = ndb.DateTimeProperty(auto_now_add=True) lastUpdateTime = ndb.DateTimeProperty(auto_now=True,indexed=False) |
2. 에러메시지
TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) |
3. 문제 : ndb.Model에 오타가.. ㅡㅡ
class BeanAndYuDataModel(ndb.Model): account = ndb.StructuredProperty(Account) data = ndb.StructuredProperty(Data)
createdTime = ndb.DateTimeProperty(auto_now_add=True) lastUpdateTime = ndb.DateTimeProperty(auto_now=True,indexed=False) |
장시간의 구글링 결과,
stack overflow에서 저와 동일한 실수를 한 사람을 찾았습니다 ^ ^
http://stackoverflow.com/questions/23653285/multiple-ndb-model-class-in-google-app-engine-with-python
그 분도 저처럼 ndb.model을 쓰셨더군요..
꼼꼼히 대소문자를 체크했는데.. "m"이 틀린걸 못 찾았네요 ㅠ
아마 다른 분들도 비슷한 에러가 나실 수 있을 것 같네요... ndb.Model을 쓰지 않는 경우라도요 ^ ^