{"action":"opened","issue":{"url":"https://api.github.com/repos/sampsyo/beets/issues/1634","labels_url":"https://api.github.com/repos/sampsyo/beets/issues/1634/labels{/name}","comments_url":"https://api.github.com/repos/sampsyo/beets/issues/1634/comments","events_url":"https://api.github.com/repos/sampsyo/beets/issues/1634/events","html_url":"https://github.com/sampsyo/beets/issues/1634","id":109694552,"number":1634,"title":"Need help with :AttributeError: type object 'NoneQuery' has no attribute 'field'","user":{"login":"jmwatte","id":768112,"avatar_url":"https://avatars.githubusercontent.com/u/768112?v=3","gravatar_id":"","url":"https://api.github.com/users/jmwatte","html_url":"https://github.com/jmwatte","followers_url":"https://api.github.com/users/jmwatte/followers","following_url":"https://api.github.com/users/jmwatte/following{/other_user}","gists_url":"https://api.github.com/users/jmwatte/gists{/gist_id}","starred_url":"https://api.github.com/users/jmwatte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmwatte/subscriptions","organizations_url":"https://api.github.com/users/jmwatte/orgs","repos_url":"https://api.github.com/users/jmwatte/repos","events_url":"https://api.github.com/users/jmwatte/events{/privacy}","received_events_url":"https://api.github.com/users/jmwatte/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-04T18:12:40Z","updated_at":"2015-10-04T18:12:40Z","closed_at":null,"body":"So, I'm trying to get the NoneQuery integrated in the query.\r\nI added :\r\n```\r\nif key is not None and term == \"\":\r\n        query_class=query.NoneQuery\r\n        return key, term, query_class\r\n```\r\n to querypqrse.py \r\nin \r\n```\r\ndef parse_query_part(part, query_classes={}, prefixes={},\r\n                     default_class=query.SubstringQuery):\r\n```\r\nand add\r\n```\r\nif query_class is query.NoneQuery:\r\n        return query_class(key.lower(), pattern)\r\n```\r\nin\r\n```\r\ndef construct_query_part(model_cls, prefixes, query_part):\r\n```\r\nso that when I do\r\n```\r\nbeet ls  lyrics:\r\n```\r\nI get\r\n```\r\nAndQuery([NoneQuery(u'lyrics', )]) <beets.dbcore.query.NullSort object at 0x7fdeff0d4710>\r\nquery AndQuery([NoneQuery(u'lyrics', )])\r\n```\r\nas q in return in\r\n```\r\ndef parse_sorted_query(model_cls, parts, prefixes={}):\r\n```\r\nbut then I always get this when I run\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/local/bin/beet\", line 9, in <module>\r\n    load_entry_point('beets==1.3.15', 'console_scripts', 'beet')()\r\n  File \"/home/wintersj/Downloads/gitdownloads/beets/beets/ui/__init__.py\", line 1163, in main\r\n    _raw_main(args)\r\n  File \"/home/wintersj/Downloads/gitdownloads/beets/beets/ui/__init__.py\", line 1153, in _raw_main\r\n    subcommand.func(lib, suboptions, subargs)\r\n  File \"/home/wintersj/Downloads/gitdownloads/beets/beets/ui/commands.py\", line 972, in list_func\r\n    list_items(lib, decargs(args), opts.album)\r\n  File \"/home/wintersj/Downloads/gitdownloads/beets/beets/ui/commands.py\", line 967, in list_items\r\n    for item in lib.items(query):\r\n  File \"/home/wintersj/Downloads/gitdownloads/beets/beets/dbcore/db.py\", line 533, in _get_objects\r\n    if not self.query or self.query.match(obj):\r\n  File \"/home/wintersj/Downloads/gitdownloads/beets/beets/dbcore/query.py\", line 442, in match\r\n    return all([q.match(item) for q in self.subqueries])\r\n  File \"/home/wintersj/Downloads/gitdownloads/beets/beets/dbcore/query.py\", line 156, in match\r\n    return not item[self.field]# or item[self.field] is None\r\nAttributeError: type object 'NoneQuery' has no attribute 'field'\r\n```\r\nHas this somethimg to do with\r\n```\r\n@classmethod\r\n    def match(self, item):\r\n        try:\r\n            return  item[self.field] is None\r\n        except KeyError:\r\n            return True\r\n```\r\nin the \r\n```\r\nclass NoneQuery(FieldQuery):\r\n```\r\nIs it because it is a classmethod with a reference to self ? (Does that make sense?)\r\n\r\nIf I hardcode it like\r\n```\r\nreturn not item[\"lyrics\"] \r\n```\r\nI get results,\r\nAny help appreciated....\r\n"}}