{"action":"created","issue":{"url":"https://api.github.com/repos/wagtail/wagtail-autocomplete/issues/34","repository_url":"https://api.github.com/repos/wagtail/wagtail-autocomplete","labels_url":"https://api.github.com/repos/wagtail/wagtail-autocomplete/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/wagtail/wagtail-autocomplete/issues/34/comments","events_url":"https://api.github.com/repos/wagtail/wagtail-autocomplete/issues/34/events","html_url":"https://github.com/wagtail/wagtail-autocomplete/issues/34","id":387841332,"node_id":"MDU6SXNzdWUzODc4NDEzMzI=","number":34,"title":"AttributeError: 'Author' object has no attribute 'title'","user":{"login":"brylie","id":17307,"node_id":"MDQ6VXNlcjE3MzA3","avatar_url":"https://avatars1.githubusercontent.com/u/17307?v=4","gravatar_id":"","url":"https://api.github.com/users/brylie","html_url":"https://github.com/brylie","followers_url":"https://api.github.com/users/brylie/followers","following_url":"https://api.github.com/users/brylie/following{/other_user}","gists_url":"https://api.github.com/users/brylie/gists{/gist_id}","starred_url":"https://api.github.com/users/brylie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brylie/subscriptions","organizations_url":"https://api.github.com/users/brylie/orgs","repos_url":"https://api.github.com/users/brylie/repos","events_url":"https://api.github.com/users/brylie/events{/privacy}","received_events_url":"https://api.github.com/users/brylie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-05T16:33:59Z","updated_at":"2018-12-05T16:51:31Z","closed_at":null,"author_association":"NONE","body":"I have followed the [instructions on using a custom search field](https://wagtail-autocomplete.readthedocs.io/en/latest/customization.html). \r\n\r\n![screenshot_20181205_183340](https://user-images.githubusercontent.com/17307/49528258-4d58b780-f8bc-11e8-9bb7-6e9894b01e63.png)\r\n\r\nHowever, even though I have specified an `autocomplete_search_field` on my `Author` model, I keep getting the following error:\r\n\r\n> AttributeError: 'Author' object has no attribute 'title'\r\n\r\nIs a migration required to get the autocomplete to work with a custom model property?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/wagtail/wagtail-autocomplete/issues/comments/444557823","html_url":"https://github.com/wagtail/wagtail-autocomplete/issues/34#issuecomment-444557823","issue_url":"https://api.github.com/repos/wagtail/wagtail-autocomplete/issues/34","id":444557823,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDU1NzgyMw==","user":{"login":"brylie","id":17307,"node_id":"MDQ6VXNlcjE3MzA3","avatar_url":"https://avatars1.githubusercontent.com/u/17307?v=4","gravatar_id":"","url":"https://api.github.com/users/brylie","html_url":"https://github.com/brylie","followers_url":"https://api.github.com/users/brylie/followers","following_url":"https://api.github.com/users/brylie/following{/other_user}","gists_url":"https://api.github.com/users/brylie/gists{/gist_id}","starred_url":"https://api.github.com/users/brylie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brylie/subscriptions","organizations_url":"https://api.github.com/users/brylie/orgs","repos_url":"https://api.github.com/users/brylie/repos","events_url":"https://api.github.com/users/brylie/events{/privacy}","received_events_url":"https://api.github.com/users/brylie/received_events","type":"User","site_admin":false},"created_at":"2018-12-05T16:51:31Z","updated_at":"2018-12-05T16:51:31Z","author_association":"NONE","body":"Adding the following code seems to make things work a bit better:\r\n\r\n```py\r\ndef render_page(page):\r\n    if getattr(page, 'specific', None):\r\n        # For support of non-Page models like Snippets.\r\n        page = page.specific\r\n    if callable(getattr(page, 'autocomplete_label', None)):\r\n        title = page.autocomplete_label()\r\n    if page.autocomplete_search_field:\r\n        search_field = page.autocomplete_search_field\r\n        title = page[search_field]\r\n    else:\r\n        title = page.title\r\n    return dict(id=page.id, title=title)\r\n```\r\n"}}
{"actor":{"display_login":"brylie"}}