{"action":"created","issue":{"url":"https://api.github.com/repos/schematics/schematics/issues/297","labels_url":"https://api.github.com/repos/schematics/schematics/issues/297/labels{/name}","comments_url":"https://api.github.com/repos/schematics/schematics/issues/297/comments","events_url":"https://api.github.com/repos/schematics/schematics/issues/297/events","html_url":"https://github.com/schematics/schematics/pull/297","id":63120877,"number":297,"title":"Support for fields order in serialized format via Options class in model","user":{"login":"delicb","id":131180,"avatar_url":"https://avatars.githubusercontent.com/u/131180?v=3","gravatar_id":"","url":"https://api.github.com/users/delicb","html_url":"https://github.com/delicb","followers_url":"https://api.github.com/users/delicb/followers","following_url":"https://api.github.com/users/delicb/following{/other_user}","gists_url":"https://api.github.com/users/delicb/gists{/gist_id}","starred_url":"https://api.github.com/users/delicb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delicb/subscriptions","organizations_url":"https://api.github.com/users/delicb/orgs","repos_url":"https://api.github.com/users/delicb/repos","events_url":"https://api.github.com/users/delicb/events{/privacy}","received_events_url":"https://api.github.com/users/delicb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-20T00:06:46Z","updated_at":"2015-03-20T15:02:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/schematics/schematics/pulls/297","html_url":"https://github.com/schematics/schematics/pull/297","diff_url":"https://github.com/schematics/schematics/pull/297.diff","patch_url":"https://github.com/schematics/schematics/pull/297.patch"},"body":"I have implemented simple way of declaring order of fields in serialized output. \r\nSomething like this does not have great technical value, but it is nice to return dictionary always in the same format when using schematics as validation layer for REST API (which is the way that I am using it).\r\n\r\nThis might not be the best way to implement this, but it reflects just the thing that I need. \r\n\r\nI was not sure what to do with fields that are not specified in `fields_order` list, so I did nothing and in that case order of fields is not guaranteed in any way, just as it is not guaranteed with `dict` (well, fields that are mentioned in `fields_order` will be pushed back, other fields will be left in front, but that is just a side effect).\r\n\r\nWhat do you think?\r\n\r\nI am opened to suggestions, if you have any."},"comment":{"url":"https://api.github.com/repos/schematics/schematics/issues/comments/84038125","html_url":"https://github.com/schematics/schematics/pull/297#issuecomment-84038125","issue_url":"https://api.github.com/repos/schematics/schematics/issues/297","id":84038125,"user":{"login":"delicb","id":131180,"avatar_url":"https://avatars.githubusercontent.com/u/131180?v=3","gravatar_id":"","url":"https://api.github.com/users/delicb","html_url":"https://github.com/delicb","followers_url":"https://api.github.com/users/delicb/followers","following_url":"https://api.github.com/users/delicb/following{/other_user}","gists_url":"https://api.github.com/users/delicb/gists{/gist_id}","starred_url":"https://api.github.com/users/delicb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delicb/subscriptions","organizations_url":"https://api.github.com/users/delicb/orgs","repos_url":"https://api.github.com/users/delicb/repos","events_url":"https://api.github.com/users/delicb/events{/privacy}","received_events_url":"https://api.github.com/users/delicb/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T15:02:27Z","updated_at":"2015-03-20T15:02:27Z","body":"@bintoro, thanks, I missed that... \r\n\r\nOk, now I am using ``OrderedDict`` from ``datastructures.py`` and tests for all python versions are passing.\r\n\r\nPlease let me know if you have any further suggestions."}}