{"action":"created","issue":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/805","repository_url":"https://api.github.com/repos/KeepSafe/aiohttp","labels_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/805/labels{/name}","comments_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/805/comments","events_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/805/events","html_url":"https://github.com/KeepSafe/aiohttp/issues/805","id":136588736,"number":805,"title":"Can't instantiate abstract class NotesView with abstract methods coll ?","user":{"login":"TechBK","id":8995895,"avatar_url":"https://avatars.githubusercontent.com/u/8995895?v=3","gravatar_id":"","url":"https://api.github.com/users/TechBK","html_url":"https://github.com/TechBK","followers_url":"https://api.github.com/users/TechBK/followers","following_url":"https://api.github.com/users/TechBK/following{/other_user}","gists_url":"https://api.github.com/users/TechBK/gists{/gist_id}","starred_url":"https://api.github.com/users/TechBK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TechBK/subscriptions","organizations_url":"https://api.github.com/users/TechBK/orgs","repos_url":"https://api.github.com/users/TechBK/repos","events_url":"https://api.github.com/users/TechBK/events{/privacy}","received_events_url":"https://api.github.com/users/TechBK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-26T03:51:05Z","updated_at":"2016-02-26T14:33:30Z","closed_at":null,"body":"Code:\r\n``` python\r\n#views.py\r\nfrom aiohttp import web\r\nimport asyncio\r\nimport aiohttp_jinja2\r\nfrom bson import json_util, objectid\r\nfrom mongoclient import db\r\n\r\nclass View(web.View):\r\n    coll = None\r\n\r\n    @property\r\n    def accepts(self):\r\n        return self.request.headers.getall('ACCEPT', [])\r\n\r\n    @property\r\n    def json(self):\r\n        return 'application/json' in self.accepts\r\n\r\n    def response(self, document):\r\n        if self.json:\r\n            return web.Response(body=json_util.dumps(document, sort_keys=True,indent=4).encode())\r\n        context = {'json': json_util.dumps(document, sort_keys=True, indent=4)}\r\n        return aiohttp_jinja2.render_template('base.html',\r\n                                              self.request,\r\n                                              context)\r\n\r\nclass DetailView(View):\r\n   \r\n    @asyncio.coroutine\r\n    def get(self):\r\n        _id = self.request.match_info.get('id', None)\r\n        _id = objectid.ObjectId(_id)\r\n        document = yield from self.coll.find_one({'_id':_id})\r\n        return self.response(document)\r\n\r\n    @asyncio.coroutine\r\n    def put(self):\r\n        _id = self.request.match_info.get('id', None)\r\n        _id = objectid.ObjectId(_id)\r\n        text = yield from self.request.text()\r\n\r\n        note = json_util.loads(text)\r\n        note.pop('_id', None)\r\n        result = yield from self.coll.update({'_id': _id}, {'$set':note})\r\n        note = yield from self.coll.find_one({'_id': _id})\r\n        return self.response(note)\r\n\r\nclass ListView(View):\r\n    @asyncio.coroutine\r\n    def get(self):\r\n        cursor = self.coll.find()\r\n        notes = yield from cursor.to_list(length=20)\r\n        return self.response(notes)\r\n\r\n    @asyncio.coroutine\r\n    def post(self):\r\n        text = yield from self.request.text()\r\n        notes = json_util.loads(text)\r\n        # return notes\r\n        ids = yield from self.coll.insert(notes)\r\n        if ids is not list:\r\n            _len = 1\r\n            ids = [ids]\r\n        else:\r\n            _len = len(ids)\r\n        cursor = self.coll.find({'_id': {'$in': ids} })\r\n        notes = yield from cursor.to_list(length=_len)\r\n\r\n        return self.response(notes)\r\n\r\nclass NoteView(DetailView):\r\n    coll = db.notes\r\n\r\nclass NotesView(ListView):\r\n    coll = db.notes\r\n```\r\n\r\nError:\r\n```\r\nError handling request\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.4/dist-packages/aiohttp/server.py\", line 266, in start\r\n    yield from self.handle_request(message, payload)\r\n  File \"/usr/local/lib/python3.4/dist-packages/aiohttp/web.py\", line 90, in handle_request\r\n    resp = yield from handler(request)\r\nTypeError: Can't instantiate abstract class NotesView with abstract methods coll\r\n\r\n    "},"comment":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/comments/189305460","html_url":"https://github.com/KeepSafe/aiohttp/issues/805#issuecomment-189305460","issue_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/805","id":189305460,"user":{"login":"asvetlov","id":356399,"avatar_url":"https://avatars.githubusercontent.com/u/356399?v=3","gravatar_id":"","url":"https://api.github.com/users/asvetlov","html_url":"https://github.com/asvetlov","followers_url":"https://api.github.com/users/asvetlov/followers","following_url":"https://api.github.com/users/asvetlov/following{/other_user}","gists_url":"https://api.github.com/users/asvetlov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetlov/subscriptions","organizations_url":"https://api.github.com/users/asvetlov/orgs","repos_url":"https://api.github.com/users/asvetlov/repos","events_url":"https://api.github.com/users/asvetlov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetlov/received_events","type":"User","site_admin":false},"created_at":"2016-02-26T14:33:30Z","updated_at":"2016-02-26T14:33:30Z","body":"Sorry, I have no enough information for reproducing your problem.\r\n\r\nI suspect some silly mistake on your side.\r\nWhere did you declare that `coll` is abstract method?\r\n`aiohttp.web.View` has no such name at all."}}