Skip to content
Advertisement

AttributeError: ‘NoneType’ object has no attribute ‘GetDataStore’

I guys, I developing a utility in python and i have 2 object the main class and an database helper for get sqlserver data.

database.py

JavaScript

gaemodel.py

JavaScript

My problem is when i try run code return me this error

JavaScript

What is wrong ??

Advertisement

Answer

First of all:

  • The __new__ method should be named __init__.
  • Remove the global _host etc. line

Then change the __init__ method:

JavaScript

And change GetDataStore:

JavaScript

That should do the trick.

I suggest you read a bit on object-oriented Python.

Advertisement