{"action":"created","issue":{"url":"https://api.github.com/repos/zulip/zulip/issues/880","repository_url":"https://api.github.com/repos/zulip/zulip","labels_url":"https://api.github.com/repos/zulip/zulip/issues/880/labels{/name}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/880/comments","events_url":"https://api.github.com/repos/zulip/zulip/issues/880/events","html_url":"https://github.com/zulip/zulip/issues/880","id":158388476,"number":880,"title":"Write a guide on how to write Zulip view code","user":{"login":"timabbott","id":2746074,"avatar_url":"https://avatars.githubusercontent.com/u/2746074?v=3","gravatar_id":"","url":"https://api.github.com/users/timabbott","html_url":"https://github.com/timabbott","followers_url":"https://api.github.com/users/timabbott/followers","following_url":"https://api.github.com/users/timabbott/following{/other_user}","gists_url":"https://api.github.com/users/timabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/timabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timabbott/subscriptions","organizations_url":"https://api.github.com/users/timabbott/orgs","repos_url":"https://api.github.com/users/timabbott/repos","events_url":"https://api.github.com/users/timabbott/events{/privacy}","received_events_url":"https://api.github.com/users/timabbott/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zulip/zulip/labels/documentation","name":"documentation","color":"c7def8"},{"url":"https://api.github.com/repos/zulip/zulip/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/zulip/zulip/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-03T15:06:31Z","updated_at":"2016-06-28T17:46:07Z","closed_at":null,"body":"This should document:\r\n* zproject/urls.py (with a pointer to Django docs on urls.py plus notes on v1_api_and_json_views since that's kinda confusing) and how to construct REST API endpoints correctly in Zulip (e.g. \"PUT\" to create a thing, \"DELETE\" to delete a thing, \"PATCH\" to edit a thing, GET to get things, and POST for anything else).\r\n* our auth decorators (mostly rest_dispatch), with discussion of how to connect to your route using a web session and the Zulip API\r\n* Probably some example test code in addition to a link to the implementation of https://github.com/zulip/zulip/issues/879\r\n* Using the REQ decorator for parsing requests, and what the various arguments to its __init__ do.\r\n* JsonableError and json_success/json_error.  \r\n* Naming conventions: validation is usually done in the view function.  do_foo should be run after validation is complete; if validation is being done in an actions function rather than the view use a name like check_foo, to clarify it is doing validation.  Document no DB writes inside views functions.\r\n* Talk about our REST endpoints and what is preferred\r\n* (There's probably more details we can add too, but this is a start and would cover the basics)\r\n\r\n@christi3k FYI since we were chatting about this idea yesterday."},"comment":{"url":"https://api.github.com/repos/zulip/zulip/issues/comments/229126666","html_url":"https://github.com/zulip/zulip/issues/880#issuecomment-229126666","issue_url":"https://api.github.com/repos/zulip/zulip/issues/880","id":229126666,"user":{"login":"timabbott","id":2746074,"avatar_url":"https://avatars.githubusercontent.com/u/2746074?v=3","gravatar_id":"","url":"https://api.github.com/users/timabbott","html_url":"https://github.com/timabbott","followers_url":"https://api.github.com/users/timabbott/followers","following_url":"https://api.github.com/users/timabbott/following{/other_user}","gists_url":"https://api.github.com/users/timabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/timabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timabbott/subscriptions","organizations_url":"https://api.github.com/users/timabbott/orgs","repos_url":"https://api.github.com/users/timabbott/repos","events_url":"https://api.github.com/users/timabbott/events{/privacy}","received_events_url":"https://api.github.com/users/timabbott/received_events","type":"User","site_admin":false},"created_at":"2016-06-28T17:46:07Z","updated_at":"2016-06-28T17:46:07Z","body":"@acrefoot is working on this one."}}
{"actor":{"display_login":"timabbott"}}