AttributeError: 'NoneType' object has no attribute 'GetDataStore'
<p>I guys, I developing a utility in python and i have 2 object the main class and an database helper for get sqlserver data.</p>

<p>database.py</p>

<pre><code>import _mssql

class sqlserver(object):

    global _host, _userid, _pwd, _db

    def __new__ (self, host, userid, pwd, database):
        _host = host
        _userid = userid
        _pwd = pwd
        _db = database

    def GetDataStore(self, sql):
        conn = _mssql.connect(server='(local)\\sqlexpress', user='sa', password='xxx', database='Framework.Data2')
        conn.execute_non_query('CREATE TABLE persons(id INT, name VARCHAR(100))')
        conn.execute_non_query("INSERT INTO persons VALUES(1, 'John Doe')")
        conn.execute_non_query("INSERT INTO persons VALUES(2, 'Jane Doe')")
</code></pre>

<p>gaemodel.py</p>

<pre><code>import os
import sys
from fwk import system, types, databases

class helper(object):
    pass

def usage(app_name):
    return "Usage: %s &lt;project name&gt;" % (app_name)

def main(argv):
    _io = system.io()

    project_name = argv[1]
    project_home = os.path.join(_io.CurrentDir(), project_name)

    _db = databases.sqlserver('(local)\sqlexpress', 'sa', 'P1lim07181702', 'Framework.Data2')    
    _db.GetDataStore("select name from sysobjects where xtype = 'U' and name not like 'Meta%'")

    str = "from google.appengine.ext import db"
    #for row in cur:
    #    str += "class %s" % row["name"]

    print cur

if __name__ == "__main__":
    if len(sys.argv) &gt; 1:
        main(sys.argv[1:])
    else:
        print usage(sys.argv[0]);
</code></pre>

<p>My problem is when i try run code return me this error</p>

<pre><code>Traceback (most recent call last):
  File "C:\Projectos\FrameworkGAE\src\gaemodel.py", line 28, in &lt;module&gt;
    main(sys.argv[1:])
  File "C:\Projectos\FrameworkGAE\src\gaemodel.py", line 18, in main
_    db. GetDataStore("select name from sysobjects where xtype = 'U' and name not like 'Meta%'")
AttributeError: 'NoneType' object has no attribute 'GetDataStore'
</code></pre>

<p>What is wrong ??</p>
