{"action":"created","issue":{"url":"https://api.github.com/repos/coleifer/peewee/issues/130","repository_url":"https://api.github.com/repos/coleifer/peewee","labels_url":"https://api.github.com/repos/coleifer/peewee/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/coleifer/peewee/issues/130/comments","events_url":"https://api.github.com/repos/coleifer/peewee/issues/130/events","html_url":"https://github.com/coleifer/peewee/issues/130","id":8491122,"number":130,"title":"TypeError: 'NoneType' object does not support item assignment when trying to select from tables after 0.9.2 to 2.0.4 upgrade","user":{"login":"skruger","id":201151,"avatar_url":"https://avatars.githubusercontent.com/u/201151?v=3","gravatar_id":"","url":"https://api.github.com/users/skruger","html_url":"https://github.com/skruger","followers_url":"https://api.github.com/users/skruger/followers","following_url":"https://api.github.com/users/skruger/following{/other_user}","gists_url":"https://api.github.com/users/skruger/gists{/gist_id}","starred_url":"https://api.github.com/users/skruger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skruger/subscriptions","organizations_url":"https://api.github.com/users/skruger/orgs","repos_url":"https://api.github.com/users/skruger/repos","events_url":"https://api.github.com/users/skruger/events{/privacy}","received_events_url":"https://api.github.com/users/skruger/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2012-11-20T02:46:27Z","updated_at":"2016-10-22T15:25:47Z","closed_at":"2012-11-20T06:29:53Z","body":"I'm upgrading my application to the current version of peewee and many of my models are failing the same way when I try to query them.  Most of my accesses happen within @classmethod calls so I did one manually from the command line and I get the same error.  I'm not sure what I'm doing wrong or what other details might help with this, but I thought I'd see if this was a known problem and I'm just messing up something simple.  Nothing has changed about the definition of this table in my upgrade process.  However, I did define a new model, called create_table(), and it seems to work.\n\nHere is the stack trace.  I'm running python2.7 and installed peewee 2.0.4 using pip.\n\n```python\n>>> XmppDomain.select().where(XmppDomain.fqdn == \"kxgx.chatwith.it\").get()\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\n  File \"/usr/local/lib/python2.7/site-packages/peewee.py\", line 1285, in get\n    return clone.execute().next()\n  File \"/usr/local/lib/python2.7/site-packages/peewee.py\", line 979, in next\n    instance = self.iterate()\n  File \"/usr/local/lib/python2.7/site-packages/peewee.py\", line 965, in iterate\n    return self.simple_iter(row)\n  File \"/usr/local/lib/python2.7/site-packages/peewee.py\", line 899, in simple_iter\n    setattr(instance, f.name, f.python_value(row[i]))\n  File \"/usr/local/lib/python2.7/site-packages/peewee.py\", line 218, in __set__\n    instance._data[self.att_name] = value\nTypeError: 'NoneType' object does not support item assignment\n```"},"comment":{"url":"https://api.github.com/repos/coleifer/peewee/issues/comments/255534674","html_url":"https://github.com/coleifer/peewee/issues/130#issuecomment-255534674","issue_url":"https://api.github.com/repos/coleifer/peewee/issues/130","id":255534674,"user":{"login":"savraj","id":387613,"avatar_url":"https://avatars.githubusercontent.com/u/387613?v=3","gravatar_id":"","url":"https://api.github.com/users/savraj","html_url":"https://github.com/savraj","followers_url":"https://api.github.com/users/savraj/followers","following_url":"https://api.github.com/users/savraj/following{/other_user}","gists_url":"https://api.github.com/users/savraj/gists{/gist_id}","starred_url":"https://api.github.com/users/savraj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savraj/subscriptions","organizations_url":"https://api.github.com/users/savraj/orgs","repos_url":"https://api.github.com/users/savraj/repos","events_url":"https://api.github.com/users/savraj/events{/privacy}","received_events_url":"https://api.github.com/users/savraj/received_events","type":"User","site_admin":false},"created_at":"2016-10-22T15:25:47Z","updated_at":"2016-10-22T15:25:47Z","body":"just ran in to a similar issue, fixed by calling super at the top of my model's __init__ as referenced in #118"}}
{"actor":{"display_login":"savraj"}}