GitHub PullRequestReviewCommentEvent at 2014-06-08 22:59:55
Repository: django
Actor: timgraham
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/13526793","id":13526793,"diff_hunk":"@@ -236,44 +501,48 @@ forms are accessible to assistive technology such as screen reader software. You\n can also :ref:`customize the way in which labels and ids are generated\n <ref-forms-api-configuring-label>`.\n \n-You can also use ``form.as_table`` to output table rows (you'll need to provide\n-your own ``<table>`` tags) and ``form.as_ul`` to output list items.\n-\n-Customizing the form template\n------------------------------\n-\n-If the default generated HTML is not to your taste, you can completely customize\n-the way a form is presented using the Django template language. Extending the\n-above example::\n-\n-    <form action=\"/contact/\" method=\"post\">\n-        {{ form.non_field_errors }}\n-        <div class=\"fieldWrapper\">\n-            {{ form.subject.errors }}\n-            <label for=\"id_subject\">Email subject:</label>\n-            {{ form.subject }}\n-        </div>\n-        <div class=\"fieldWrapper\">\n-            {{ form.message.errors }}\n-            <label for=\"id_message\">Your message:</label>\n-            {{ form.message }}\n-        </div>\n-        <div class=\"fieldWrapper\">\n-            {{ form.sender.errors }}\n-            <label for=\"id_sender\">Your email address:</label>\n-            {{ form.sender }}\n-        </div>\n-        <div class=\"fieldWrapper\">\n-            {{ form.cc_myself.errors }}\n-            <label for=\"id_cc_myself\">CC yourself?</label>\n-            {{ form.cc_myself }}\n-        </div>\n-        <p><input type=\"submit\" value=\"Send message\" /></p>\n-    </form>\n-\n-Each named form-field can be output to the template using\n-``{{ form.name_of_field }}``, which will produce the HTML needed to display the\n-form widget. Using ``{{ form.name_of_field.errors }}`` displays a list of form\n+See :ref:`ref-forms-api-outputting-html` for more on this.\n+\n+Rendering fields manually\n+-------------------------\n+\n+We don't have to let Django unpack the form's fields; we can do it manually if\n+we like (allowing us to re-order the fields, for example). Each field is\n+available as an attribute of the form using ``{{ form.name_of_field }}``, and\n+in a Django template, will be rendered appropriately. For example::\n+\n+    {{ form.non_field_errors }}\n+    <div class=\"fieldWrapper\">\n+        {{ form.subject.errors }}\n+        <label for=\"id_subject\">Email subject:</label>\n+        {{ form.subject }}\n+    </div>\n+    <div class=\"fieldWrapper\">\n+        {{ form.message.errors }}\n+        <label for=\"id_message\">Your message:</label>\n+        {{ form.message }}\n+    </div>\n+    <div class=\"fieldWrapper\">\n+        {{ form.sender.errors }}\n+        <label for=\"id_sender\">Your email address:</label>\n+        {{ form.sender }}\n+    </div>\n+    <div class=\"fieldWrapper\">\n+        {{ form.cc_myself.errors }}\n+        <label for=\"id_cc_myself\">CC yourself?</label>\n+        {{ form.cc_myself }}\n+    </div>\n+\n+Rendering form error messages\n+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n+\n+The price of this flexibility of course is more work. Until now we haven't had\n+to worry about how to display form errors, because that's taken care of for us.\n+In this example, we have had to make sure we take care of any errors for each\n+field, and any errors for the form as a whole. Note ``{{ form.non_field_errors","path":"docs/topics/forms/index.txt","position":699,"original_position":699,"commit_id":"57f5e2ba3b927a271c871e8ea9ff6fdc60c6a917","original_commit_id":"57f5e2ba3b927a271c871e8ea9ff6fdc60c6a917","user":{"login":"timgraham","id":411869,"avatar_url":"https://avatars.githubusercontent.com/u/411869?","gravatar_id":"fa170777273ca7b235bdde7d80e9f8a6","url":"https://api.github.com/users/timgraham","html_url":"https://github.com/timgraham","followers_url":"https://api.github.com/users/timgraham/followers","following_url":"https://api.github.com/users/timgraham/following{/other_user}","gists_url":"https://api.github.com/users/timgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/timgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgraham/subscriptions","organizations_url":"https://api.github.com/users/timgraham/orgs","repos_url":"https://api.github.com/users/timgraham/repos","events_url":"https://api.github.com/users/timgraham/events{/privacy}","received_events_url":"https://api.github.com/users/timgraham/received_events","type":"User","site_admin":false},"body":"chop comma","created_at":"2014-06-08T22:59:55Z","updated_at":"2014-06-08T22:59:55Z","html_url":"https://github.com/django/django/pull/2776#discussion_r13526793","pull_request_url":"https://api.github.com/repos/django/django/pulls/2776","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/13526793"},"html":{"href":"https://github.com/django/django/pull/2776#discussion_r13526793"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/2776"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/2776","id":16865648,"html_url":"https://github.com/django/django/pull/2776","diff_url":"https://github.com/django/django/pull/2776.diff","patch_url":"https://github.com/django/django/pull/2776.patch","issue_url":"https://api.github.com/repos/django/django/issues/2776","number":2776,"state":"open","title":"Fixed #22796 -- Added more basic explanations of forms","user":{"login":"evildmp","id":86222,"avatar_url":"https://avatars.githubusercontent.com/u/86222?","gravatar_id":"cbd39c9ab76dbd15f5429648e29c99ad","url":"https://api.github.com/users/evildmp","html_url":"https://github.com/evildmp","followers_url":"https://api.github.com/users/evildmp/followers","following_url":"https://api.github.com/users/evildmp/following{/other_user}","gists_url":"https://api.github.com/users/evildmp/gists{/gist_id}","starred_url":"https://api.github.com/users/evildmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evildmp/subscriptions","organizations_url":"https://api.github.com/users/evildmp/orgs","repos_url":"https://api.github.com/users/evildmp/repos","events_url":"https://api.github.com/users/evildmp/events{/privacy}","received_events_url":"https://api.github.com/users/evildmp/received_events","type":"User","site_admin":false},"body":"Now explains some more basic form handling before discussing Django;\r\nsimplifies initial examples; defers explanation of more advanced\r\naspects until later in the document","created_at":"2014-06-08T19:06:34Z","updated_at":"2014-06-08T22:59:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"602d41c7cf1cc0a48d812410aa6f307e0163222e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/2776/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/2776/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments/{number}","comments_url":"https://api.github.com/repos/django/django/issues/2776/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/57f5e2ba3b927a271c871e8ea9ff6fdc60c6a917","head":{"label":"evildmp:ticket_22796","ref":"ticket_22796","sha":"57f5e2ba3b927a271c871e8ea9ff6fdc60c6a917","user":{"login":"evildmp","id":86222,"avatar_url":"https://avatars.githubusercontent.com/u/86222?","gravatar_id":"cbd39c9ab76dbd15f5429648e29c99ad","url":"https://api.github.com/users/evildmp","html_url":"https://github.com/evildmp","followers_url":"https://api.github.com/users/evildmp/followers","following_url":"https://api.github.com/users/evildmp/following{/other_user}","gists_url":"https://api.github.com/users/evildmp/gists{/gist_id}","starred_url":"https://api.github.com/users/evildmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evildmp/subscriptions","organizations_url":"https://api.github.com/users/evildmp/orgs","repos_url":"https://api.github.com/users/evildmp/repos","events_url":"https://api.github.com/users/evildmp/events{/privacy}","received_events_url":"https://api.github.com/users/evildmp/received_events","type":"User","site_admin":false},"repo":{"id":4570262,"name":"django","full_name":"evildmp/django","owner":{"login":"evildmp","id":86222,"avatar_url":"https://avatars.githubusercontent.com/u/86222?","gravatar_id":"cbd39c9ab76dbd15f5429648e29c99ad","url":"https://api.github.com/users/evildmp","html_url":"https://github.com/evildmp","followers_url":"https://api.github.com/users/evildmp/followers","following_url":"https://api.github.com/users/evildmp/following{/other_user}","gists_url":"https://api.github.com/users/evildmp/gists{/gist_id}","starred_url":"https://api.github.com/users/evildmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evildmp/subscriptions","organizations_url":"https://api.github.com/users/evildmp/orgs","repos_url":"https://api.github.com/users/evildmp/repos","events_url":"https://api.github.com/users/evildmp/events{/privacy}","received_events_url":"https://api.github.com/users/evildmp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/evildmp/django","description":"The Web framework for perfectionists with deadlines. Now on GitHub.","fork":true,"url":"https://api.github.com/repos/evildmp/django","forks_url":"https://api.github.com/repos/evildmp/django/forks","keys_url":"https://api.github.com/repos/evildmp/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evildmp/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evildmp/django/teams","hooks_url":"https://api.github.com/repos/evildmp/django/hooks","issue_events_url":"https://api.github.com/repos/evildmp/django/issues/events{/number}","events_url":"https://api.github.com/repos/evildmp/django/events","assignees_url":"https://api.github.com/repos/evildmp/django/assignees{/user}","branches_url":"https://api.github.com/repos/evildmp/django/branches{/branch}","tags_url":"https://api.github.com/repos/evildmp/django/tags","blobs_url":"https://api.github.com/repos/evildmp/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evildmp/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evildmp/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/evildmp/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evildmp/django/statuses/{sha}","languages_url":"https://api.github.com/repos/evildmp/django/languages","stargazers_url":"https://api.github.com/repos/evildmp/django/stargazers","contributors_url":"https://api.github.com/repos/evildmp/django/contributors","subscribers_url":"https://api.github.com/repos/evildmp/django/subscribers","subscription_url":"https://api.github.com/repos/evildmp/django/subscription","commits_url":"https://api.github.com/repos/evildmp/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/evildmp/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/evildmp/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/evildmp/django/issues/comments/{number}","contents_url":"https://api.github.com/repos/evildmp/django/contents/{+path}","compare_url":"https://api.github.com/repos/evildmp/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evildmp/django/merges","archive_url":"https://api.github.com/repos/evildmp/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evildmp/django/downloads","issues_url":"https://api.github.com/repos/evildmp/django/issues{/number}","pulls_url":"https://api.github.com/repos/evildmp/django/pulls{/number}","milestones_url":"https://api.github.com/repos/evildmp/django/milestones{/number}","notifications_url":"https://api.github.com/repos/evildmp/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evildmp/django/labels{/name}","releases_url":"https://api.github.com/repos/evildmp/django/releases{/id}","created_at":"2012-06-06T08:23:12Z","updated_at":"2014-06-08T19:06:34Z","pushed_at":"2014-06-08T19:06:15Z","git_url":"git://github.com/evildmp/django.git","ssh_url":"git@github.com:evildmp/django.git","clone_url":"https://github.com/evildmp/django.git","svn_url":"https://github.com/evildmp/django","homepage":"http://www.djangoproject.com/","size":83707,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"d8f6b55aa8f05a479eb0018b470932805f2c95d1","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?","gravatar_id":"fd542381031aa84dca86628ece84fc07","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?","gravatar_id":"fd542381031aa84dca86628ece84fc07","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments/{number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","created_at":"2012-04-28T02:47:18Z","updated_at":"2014-06-08T20:31:51Z","pushed_at":"2014-06-08T19:18:03Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"http://www.djangoproject.com/","size":205487,"stargazers_count":10060,"watchers_count":10060,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":3838,"mirror_url":null,"open_issues_count":125,"forks":3838,"open_issues":125,"watchers":10060,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/2776"},"html":{"href":"https://github.com/django/django/pull/2776"},"issue":{"href":"https://api.github.com/repos/django/django/issues/2776"},"comments":{"href":"https://api.github.com/repos/django/django/issues/2776/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/2776/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/2776/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/57f5e2ba3b927a271c871e8ea9ff6fdc60c6a917"}}}}