{"action":"created","issue":{"url":"https://api.github.com/repos/clarkduvall/serpy/issues/34","repository_url":"https://api.github.com/repos/clarkduvall/serpy","labels_url":"https://api.github.com/repos/clarkduvall/serpy/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/clarkduvall/serpy/issues/34/comments","events_url":"https://api.github.com/repos/clarkduvall/serpy/issues/34/events","html_url":"https://github.com/clarkduvall/serpy/pull/34","id":176836183,"number":34,"title":"Add a method for adding field after the definition of a serializer","user":{"login":"kinnou02","id":448185,"avatar_url":"https://avatars.githubusercontent.com/u/448185?v=3","gravatar_id":"","url":"https://api.github.com/users/kinnou02","html_url":"https://github.com/kinnou02","followers_url":"https://api.github.com/users/kinnou02/followers","following_url":"https://api.github.com/users/kinnou02/following{/other_user}","gists_url":"https://api.github.com/users/kinnou02/gists{/gist_id}","starred_url":"https://api.github.com/users/kinnou02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinnou02/subscriptions","organizations_url":"https://api.github.com/users/kinnou02/orgs","repos_url":"https://api.github.com/users/kinnou02/repos","events_url":"https://api.github.com/users/kinnou02/events{/privacy}","received_events_url":"https://api.github.com/users/kinnou02/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-14T07:36:56Z","updated_at":"2016-09-19T07:54:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/clarkduvall/serpy/pulls/34","html_url":"https://github.com/clarkduvall/serpy/pull/34","diff_url":"https://github.com/clarkduvall/serpy/pull/34.diff","patch_url":"https://github.com/clarkduvall/serpy/pull/34.patch"},"body":"It's useful in case of circular dependency.\r\nTypically we have something like this:\r\n```python\r\nASerilizer(Serializer):\r\n    b = BSerializer(many=True)\r\n\r\nBSerializer(Serializer):\r\n    a = ASerializer(many=True)\r\n```\r\n\r\nThis isn't possible in python because BSerializer isn't yet define when\r\nwe want to use it in ASerilizer. This Function give us the ability to\r\nsolve this problem this way:\r\n\r\n```python\r\nASerilizer(Serializer):\r\n    pass\r\n\r\nBSerializer(Serializer):\r\n    a = ASerializer(many=True)\r\n\r\nASerilizer.add_field('b', BSerializer(many=True)\r\n```\r\n\r\nOf course if the serialized objects reference themselves there will be\r\nsome infinite loop.\r\n\r\nIf this proposition is fine for you I could add some documentation about it."},"comment":{"url":"https://api.github.com/repos/clarkduvall/serpy/issues/comments/247930592","html_url":"https://github.com/clarkduvall/serpy/pull/34#issuecomment-247930592","issue_url":"https://api.github.com/repos/clarkduvall/serpy/issues/34","id":247930592,"user":{"login":"kinnou02","id":448185,"avatar_url":"https://avatars.githubusercontent.com/u/448185?v=3","gravatar_id":"","url":"https://api.github.com/users/kinnou02","html_url":"https://github.com/kinnou02","followers_url":"https://api.github.com/users/kinnou02/followers","following_url":"https://api.github.com/users/kinnou02/following{/other_user}","gists_url":"https://api.github.com/users/kinnou02/gists{/gist_id}","starred_url":"https://api.github.com/users/kinnou02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinnou02/subscriptions","organizations_url":"https://api.github.com/users/kinnou02/orgs","repos_url":"https://api.github.com/users/kinnou02/repos","events_url":"https://api.github.com/users/kinnou02/events{/privacy}","received_events_url":"https://api.github.com/users/kinnou02/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T07:54:30Z","updated_at":"2016-09-19T07:54:30Z","body":"Thanks, I didn't think of using a method field, it's solve my issue.\r\nUpdating every sub class will probably be tricky, I agree with you that this case isn't common, so I will close this PR."}}
{"actor":{"display_login":"kinnou02"}}