{"action":"created","issue":{"url":"https://api.github.com/repos/alastair/python-musicbrainzngs/issues/190","repository_url":"https://api.github.com/repos/alastair/python-musicbrainzngs","labels_url":"https://api.github.com/repos/alastair/python-musicbrainzngs/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/alastair/python-musicbrainzngs/issues/190/comments","events_url":"https://api.github.com/repos/alastair/python-musicbrainzngs/issues/190/events","html_url":"https://github.com/alastair/python-musicbrainzngs/pull/190","id":129394377,"number":190,"title":"Read xml attributes and values from <attribute-list> elements","user":{"login":"alastair","id":19217,"avatar_url":"https://avatars.githubusercontent.com/u/19217?v=3","gravatar_id":"","url":"https://api.github.com/users/alastair","html_url":"https://github.com/alastair","followers_url":"https://api.github.com/users/alastair/followers","following_url":"https://api.github.com/users/alastair/following{/other_user}","gists_url":"https://api.github.com/users/alastair/gists{/gist_id}","starred_url":"https://api.github.com/users/alastair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alastair/subscriptions","organizations_url":"https://api.github.com/users/alastair/orgs","repos_url":"https://api.github.com/users/alastair/repos","events_url":"https://api.github.com/users/alastair/events{/privacy}","received_events_url":"https://api.github.com/users/alastair/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/alastair/python-musicbrainzngs/milestones/7","html_url":"https://github.com/alastair/python-musicbrainzngs/milestones/0.6","labels_url":"https://api.github.com/repos/alastair/python-musicbrainzngs/milestones/7/labels","id":561032,"number":7,"title":"0.6","description":"","creator":{"login":"alastair","id":19217,"avatar_url":"https://avatars.githubusercontent.com/u/19217?v=3","gravatar_id":"","url":"https://api.github.com/users/alastair","html_url":"https://github.com/alastair","followers_url":"https://api.github.com/users/alastair/followers","following_url":"https://api.github.com/users/alastair/following{/other_user}","gists_url":"https://api.github.com/users/alastair/gists{/gist_id}","starred_url":"https://api.github.com/users/alastair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alastair/subscriptions","organizations_url":"https://api.github.com/users/alastair/orgs","repos_url":"https://api.github.com/users/alastair/repos","events_url":"https://api.github.com/users/alastair/events{/privacy}","received_events_url":"https://api.github.com/users/alastair/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":42,"state":"open","created_at":"2014-02-06T15:20:36Z","updated_at":"2016-03-16T10:12:52Z","due_on":"2014-02-28T08:00:00Z","closed_at":null},"comments":7,"created_at":"2016-01-28T09:29:44Z","updated_at":"2016-04-04T21:03:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alastair/python-musicbrainzngs/pulls/190","html_url":"https://github.com/alastair/python-musicbrainzngs/pull/190","diff_url":"https://github.com/alastair/python-musicbrainzngs/pull/190.diff","patch_url":"https://github.com/alastair/python-musicbrainzngs/pull/190.patch"},"body":"Last part of #142!\r\n\r\nPreviously, with <attribute> values, we only read the text value,\r\nhowever now these tags can have value=\"\" and credited-as=\"\"\r\nattributes, which we now read. We add these to a separate list of\r\ndictionaries to keep backwards compatibility with the existing\r\nattribute-list element.\r\n\r\nNeed to add some documentation saying to now use the new element\r\n\r\nI'm not sure about the implementation of parse_relation_attribute_element. I thought that these attributes could be anything, but looking at the mmd I see there are only two options - `value` and `credited-as` (https://bitbucket.org/metabrainz/mmd-schema/src/master/schema/musicbrainz_mmd-2.0.rng?fileviewer=file-view-default#musicbrainz_mmd-2.0.rng-2311:2317). Perhaps we could just adapt `parse_work_attribute` to support the three attributes (including `type`) and adjust it as new changes are made to mmd. The current system means we have forward compatibility, but that hasn't stopped us parsing this data strictly in the past.\r\n\r\nI added the `attribute-dict` item to works as well, although it seems we don't have a backwards compatibility problem here, as this list has always been a dict. Should we remove `attribute-dict` then? It's strange that we have `attribute-list` appearing in two places (relations, and works), with different meanings.\r\n\r\nThe name `attribute-dict` still doesn't make me feel happy, especially that it's a list of dicts. Do we call it `attribute-dicts`? Perhaps we could just call it `attributes` - it doesn't reflect the XML as strictly as we normally follow it, but it is a lot simpler to read.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/alastair/python-musicbrainzngs/issues/comments/205496375","html_url":"https://github.com/alastair/python-musicbrainzngs/pull/190#issuecomment-205496375","issue_url":"https://api.github.com/repos/alastair/python-musicbrainzngs/issues/190","id":205496375,"user":{"login":"alastair","id":19217,"avatar_url":"https://avatars.githubusercontent.com/u/19217?v=3","gravatar_id":"","url":"https://api.github.com/users/alastair","html_url":"https://github.com/alastair","followers_url":"https://api.github.com/users/alastair/followers","following_url":"https://api.github.com/users/alastair/following{/other_user}","gists_url":"https://api.github.com/users/alastair/gists{/gist_id}","starred_url":"https://api.github.com/users/alastair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alastair/subscriptions","organizations_url":"https://api.github.com/users/alastair/orgs","repos_url":"https://api.github.com/users/alastair/repos","events_url":"https://api.github.com/users/alastair/events{/privacy}","received_events_url":"https://api.github.com/users/alastair/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T21:03:11Z","updated_at":"2016-04-04T21:03:11Z","body":"thanks @kepstin and @mwiencek! The verification is just what I needed. It's not too difficult to special-case 5, since this is only used in work attributes, and it's a different codepath than all other attributes anyway. "}}