{"action":"created","issue":{"url":"https://api.github.com/repos/jrief/django-angular/issues/210","labels_url":"https://api.github.com/repos/jrief/django-angular/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/jrief/django-angular/issues/210/comments","events_url":"https://api.github.com/repos/jrief/django-angular/issues/210/events","html_url":"https://github.com/jrief/django-angular/pull/210","id":119323947,"number":210,"title":"Fix prefix handling in NgModelFormMixin","user":{"login":"DavidCain","id":901169,"avatar_url":"https://avatars.githubusercontent.com/u/901169?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidCain","html_url":"https://github.com/DavidCain","followers_url":"https://api.github.com/users/DavidCain/followers","following_url":"https://api.github.com/users/DavidCain/following{/other_user}","gists_url":"https://api.github.com/users/DavidCain/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidCain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidCain/subscriptions","organizations_url":"https://api.github.com/users/DavidCain/orgs","repos_url":"https://api.github.com/users/DavidCain/repos","events_url":"https://api.github.com/users/DavidCain/events{/privacy}","received_events_url":"https://api.github.com/users/DavidCain/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-28T23:16:09Z","updated_at":"2015-11-29T00:01:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jrief/django-angular/pulls/210","html_url":"https://github.com/jrief/django-angular/pull/210","diff_url":"https://github.com/jrief/django-angular/pull/210.diff","patch_url":"https://github.com/jrief/django-angular/pull/210.patch"},"body":"If you have multiple forms in one page, and use Django's `prefix` attribute to distinguish them, Djangular will error out initializing the form:\r\n\r\n    'NoneType' object has no attribute 'items'\r\n\r\nThe prefix-handling code within `NgModelFormMixin` was assuming that form data would be nested in a subdictionary by a prefix, like so:\r\n\r\n```python\r\n{'name': \"Fred\",\r\n 'contact_info': {'name': 'Steve',\r\n                  'phone': '555-1234'}\r\n}\r\n```\r\n\r\nInstead, prefixed form data looks like this:\r\n```python\r\n{'name': \"Fred\",\r\n 'contact_info.name': 'Steve',\r\n 'contact_info.phone': '555-1234'\r\n}\r\n```\r\n\r\n(Fields would normally be [`'contact_info-name'`][add_prefix] under Django 1.6-1.8, but Djangular overrides this to use a dot separator for Angular).\r\n\r\n----------\r\n\r\nI've tested this on Django 1.7 and 1.8. `_post_clean()` still works as expected.\r\n\r\n[add_prefix]: https://github.com/django/django/blob/1.8.7/django/forms/forms.py#L186"},"comment":{"url":"https://api.github.com/repos/jrief/django-angular/issues/comments/160347859","html_url":"https://github.com/jrief/django-angular/pull/210#issuecomment-160347859","issue_url":"https://api.github.com/repos/jrief/django-angular/issues/210","id":160347859,"user":{"login":"DavidCain","id":901169,"avatar_url":"https://avatars.githubusercontent.com/u/901169?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidCain","html_url":"https://github.com/DavidCain","followers_url":"https://api.github.com/users/DavidCain/followers","following_url":"https://api.github.com/users/DavidCain/following{/other_user}","gists_url":"https://api.github.com/users/DavidCain/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidCain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidCain/subscriptions","organizations_url":"https://api.github.com/users/DavidCain/orgs","repos_url":"https://api.github.com/users/DavidCain/repos","events_url":"https://api.github.com/users/DavidCain/events{/privacy}","received_events_url":"https://api.github.com/users/DavidCain/received_events","type":"User","site_admin":false},"created_at":"2015-11-29T00:01:41Z","updated_at":"2015-11-29T00:01:41Z","body":"Will do - (probably won't have time tonight, but I'll check back)."}}