{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/37008075","id":37008075,"diff_hunk":"@@ -830,107 +830,228 @@ The field-specific output honors the form object's ``auto_id`` setting::\n     >>> print(f['message'])\n     <input type=\"text\" name=\"message\" id=\"id_message\" />\n \n-For a field's list of errors, access the field's ``errors`` attribute.\n+Attributes of ``BoundField``\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n \n-.. attribute:: BoundField.errors\n+.. attribute:: BoundField.auto_id\n \n-A list-like object that is displayed as an HTML ``<ul class=\"errorlist\">``\n-when printed::\n+    Calculates and returns the ID attribute for this BoundField if the\n+    associated Form has specified auto_id. Returns an empty string otherwise.\n \n-    >>> data = {'subject': 'hi', 'message': '', 'sender': '', 'cc_myself': ''}\n-    >>> f = ContactForm(data, auto_id=False)\n-    >>> print(f['message'])\n-    <input type=\"text\" name=\"message\" />\n-    >>> f['message'].errors\n-    ['This field is required.']\n-    >>> print(f['message'].errors)\n-    <ul class=\"errorlist\"><li>This field is required.</li></ul>\n-    >>> f['subject'].errors\n-    []\n-    >>> print(f['subject'].errors)\n+    .. note::\n+       This attribute gets calculated by the form only, so if the field's\n+       widget overrides :meth:`~django.forms.Widget.id_for_label` this ID\n+       is likely to be wrong.\n \n-    >>> str(f['subject'].errors)\n-    ''\n+       If you use :class:`~django.forms.BoundField.as_widget` or similar\n+       methods that render the field with its widget (``__str__`` does this,\n+       too), use :attr:`~django.forms.BoundField.id_for_label` instead.\n \n-.. method:: BoundField.label_tag(contents=None, attrs=None, label_suffix=None)\n+.. attribute:: BoundField.data\n \n-To separately render the label tag of a form field, you can call its\n-``label_tag`` method::\n+    This property returns the data for this :class:`~django.forms.BoundField`\n+    extracted by the widget's :meth:`~django.forms.Widget.value_from_datadict`\n+    method, or ``None`` if it wasn't given::\n \n-    >>> f = ContactForm(data)\n-    >>> print(f['message'].label_tag())\n-    <label for=\"id_message\">Message:</label>\n+        >>> unbound_form = ContactForm()\n+        >>> print(unbound_form['subject'].data)\n+        None\n+        >>> bound_form = ContactForm(data={'subject': 'My Subject'})\n+        >>> print(bound_form['subject'].data)\n+        My Subject\n \n-Optionally, you can provide the ``contents`` parameter which will replace the\n-auto-generated label tag. An optional ``attrs`` dictionary may contain\n-additional attributes for the ``<label>`` tag.\n+.. attribute:: BoundField.errors\n \n-The HTML that's generated includes the form's\n-:attr:`~django.forms.Form.label_suffix` (a colon, by default) or, if set, the\n-current field's :attr:`~django.forms.Field.label_suffix`. The optional\n-``label_suffix`` parameter allows you to override any previously set\n-suffix. For example, you can use an empty string to hide the label on selected\n-fields. If you need to do this in a template, you could write a custom\n-filter to allow passing parameters to ``label_tag``.\n+    A list-like object that is displayed as an HTML ``<ul class=\"errorlist\">``\n+    when printed::\n \n-.. versionchanged:: 1.8\n+        >>> data = {'subject': 'hi', 'message': '', 'sender': '', 'cc_myself': ''}\n+        >>> f = ContactForm(data, auto_id=False)\n+        >>> print(f['message'])\n+        <input type=\"text\" name=\"message\" />\n+        >>> f['message'].errors\n+        ['This field is required.']\n+        >>> print(f['message'].errors)\n+        <ul class=\"errorlist\"><li>This field is required.</li></ul>\n+        >>> f['subject'].errors\n+        []\n+        >>> print(f['subject'].errors)\n \n-    The label includes :attr:`~Form.required_css_class` if applicable.\n+        >>> str(f['subject'].errors)\n+        ''\n \n-.. method:: BoundField.css_classes()\n+.. attribute:: BoundField.field\n \n-When you use Django's rendering shortcuts, CSS classes are used to\n-indicate required form fields or fields that contain errors. If you're\n-manually rendering a form, you can access these CSS classes using the\n-``css_classes`` method::\n+    The :class:`~django.forms.Field` instance from the form class that this\n+    :class:`~django.forms.BoundField` wraps.\n \n-    >>> f = ContactForm(data)\n-    >>> f['message'].css_classes()\n-    'required'\n+.. attribute:: BoundField.form\n \n-If you want to provide some additional classes in addition to the\n-error and required classes that may be required, you can provide\n-those classes as an argument::\n+    The :class:`~django.forms.Form` instance this :class:`~django.forms.BoundField`\n+    is bound to.\n \n-    >>> f = ContactForm(data)\n-    >>> f['message'].css_classes('foo bar')\n-    'foo bar required'\n+.. attribute:: BoundField.help_text\n \n-.. method:: BoundField.value()\n+    :attr:`~django.forms.Field.help_text` of the field.\n+\n+.. attribute:: BoundField.html_initial_id","path":"docs/ref/forms/api.txt","position":127,"original_position":127,"commit_id":"48a53bd6a87f887a1d5c766565156985bd11e037","original_commit_id":"48a53bd6a87f887a1d5c766565156985bd11e037","user":{"login":"timgraham","id":411869,"avatar_url":"https://avatars.githubusercontent.com/u/411869?v=3","gravatar_id":"","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":"I think it depends on the outcome of the decision about how extensible this API is meant to be. Personally, I see BoundField as an API that's largely meant for use in templates, so documenting the methods that aren't meant to be called from there (e.g. most of the methods with arguments) doesn't make much sense to me. If we open things to allow substituting your own BoundField class, then this might change.","created_at":"2015-08-13T18:26:10Z","updated_at":"2015-08-13T18:26:10Z","html_url":"https://github.com/django/django/pull/5123#discussion_r37008075","pull_request_url":"https://api.github.com/repos/django/django/pulls/5123","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/37008075"},"html":{"href":"https://github.com/django/django/pull/5123#discussion_r37008075"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/5123"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/5123","id":42010194,"html_url":"https://github.com/django/django/pull/5123","diff_url":"https://github.com/django/django/pull/5123.diff","patch_url":"https://github.com/django/django/pull/5123.patch","issue_url":"https://api.github.com/repos/django/django/issues/5123","number":5123,"state":"open","locked":false,"title":"Fixed #12856 -- Document BoundField API","user":{"login":"MoritzS","id":1687843,"avatar_url":"https://avatars.githubusercontent.com/u/1687843?v=3","gravatar_id":"","url":"https://api.github.com/users/MoritzS","html_url":"https://github.com/MoritzS","followers_url":"https://api.github.com/users/MoritzS/followers","following_url":"https://api.github.com/users/MoritzS/following{/other_user}","gists_url":"https://api.github.com/users/MoritzS/gists{/gist_id}","starred_url":"https://api.github.com/users/MoritzS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoritzS/subscriptions","organizations_url":"https://api.github.com/users/MoritzS/orgs","repos_url":"https://api.github.com/users/MoritzS/repos","events_url":"https://api.github.com/users/MoritzS/events{/privacy}","received_events_url":"https://api.github.com/users/MoritzS/received_events","type":"User","site_admin":false},"body":"Ticket: https://code.djangoproject.com/ticket/12856","created_at":"2015-08-10T11:26:40Z","updated_at":"2015-08-13T18:26:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"427fb4e68361cb9792f3b6212d31654f7741765b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/5123/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/5123/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/5123/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/48a53bd6a87f887a1d5c766565156985bd11e037","head":{"label":"MoritzS:ticket_12856","ref":"ticket_12856","sha":"48a53bd6a87f887a1d5c766565156985bd11e037","user":{"login":"MoritzS","id":1687843,"avatar_url":"https://avatars.githubusercontent.com/u/1687843?v=3","gravatar_id":"","url":"https://api.github.com/users/MoritzS","html_url":"https://github.com/MoritzS","followers_url":"https://api.github.com/users/MoritzS/followers","following_url":"https://api.github.com/users/MoritzS/following{/other_user}","gists_url":"https://api.github.com/users/MoritzS/gists{/gist_id}","starred_url":"https://api.github.com/users/MoritzS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoritzS/subscriptions","organizations_url":"https://api.github.com/users/MoritzS/orgs","repos_url":"https://api.github.com/users/MoritzS/repos","events_url":"https://api.github.com/users/MoritzS/events{/privacy}","received_events_url":"https://api.github.com/users/MoritzS/received_events","type":"User","site_admin":false},"repo":{"id":4182584,"name":"django","full_name":"MoritzS/django","owner":{"login":"MoritzS","id":1687843,"avatar_url":"https://avatars.githubusercontent.com/u/1687843?v=3","gravatar_id":"","url":"https://api.github.com/users/MoritzS","html_url":"https://github.com/MoritzS","followers_url":"https://api.github.com/users/MoritzS/followers","following_url":"https://api.github.com/users/MoritzS/following{/other_user}","gists_url":"https://api.github.com/users/MoritzS/gists{/gist_id}","starred_url":"https://api.github.com/users/MoritzS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoritzS/subscriptions","organizations_url":"https://api.github.com/users/MoritzS/orgs","repos_url":"https://api.github.com/users/MoritzS/repos","events_url":"https://api.github.com/users/MoritzS/events{/privacy}","received_events_url":"https://api.github.com/users/MoritzS/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MoritzS/django","description":"The Web framework for perfectionists with deadlines. Now on GitHub.","fork":true,"url":"https://api.github.com/repos/MoritzS/django","forks_url":"https://api.github.com/repos/MoritzS/django/forks","keys_url":"https://api.github.com/repos/MoritzS/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MoritzS/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MoritzS/django/teams","hooks_url":"https://api.github.com/repos/MoritzS/django/hooks","issue_events_url":"https://api.github.com/repos/MoritzS/django/issues/events{/number}","events_url":"https://api.github.com/repos/MoritzS/django/events","assignees_url":"https://api.github.com/repos/MoritzS/django/assignees{/user}","branches_url":"https://api.github.com/repos/MoritzS/django/branches{/branch}","tags_url":"https://api.github.com/repos/MoritzS/django/tags","blobs_url":"https://api.github.com/repos/MoritzS/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MoritzS/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MoritzS/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/MoritzS/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MoritzS/django/statuses/{sha}","languages_url":"https://api.github.com/repos/MoritzS/django/languages","stargazers_url":"https://api.github.com/repos/MoritzS/django/stargazers","contributors_url":"https://api.github.com/repos/MoritzS/django/contributors","subscribers_url":"https://api.github.com/repos/MoritzS/django/subscribers","subscription_url":"https://api.github.com/repos/MoritzS/django/subscription","commits_url":"https://api.github.com/repos/MoritzS/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/MoritzS/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/MoritzS/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/MoritzS/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/MoritzS/django/contents/{+path}","compare_url":"https://api.github.com/repos/MoritzS/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MoritzS/django/merges","archive_url":"https://api.github.com/repos/MoritzS/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MoritzS/django/downloads","issues_url":"https://api.github.com/repos/MoritzS/django/issues{/number}","pulls_url":"https://api.github.com/repos/MoritzS/django/pulls{/number}","milestones_url":"https://api.github.com/repos/MoritzS/django/milestones{/number}","notifications_url":"https://api.github.com/repos/MoritzS/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MoritzS/django/labels{/name}","releases_url":"https://api.github.com/repos/MoritzS/django/releases{/id}","created_at":"2012-04-30T12:29:55Z","updated_at":"2015-03-26T15:24:12Z","pushed_at":"2015-08-10T11:25:33Z","git_url":"git://github.com/MoritzS/django.git","ssh_url":"git@github.com:MoritzS/django.git","clone_url":"https://github.com/MoritzS/django.git","svn_url":"https://github.com/MoritzS/django","homepage":"http://www.djangoproject.com/","size":115041,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"12f91f6ebdd2470197fff4e053b50f3e54294028","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","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?v=3","gravatar_id":"","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":"2015-08-13T15:49:53Z","pushed_at":"2015-08-13T18:17:28Z","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":"https://www.djangoproject.com/","size":300321,"stargazers_count":15523,"watchers_count":15523,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6203,"mirror_url":null,"open_issues_count":73,"forks":6203,"open_issues":73,"watchers":15523,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/5123"},"html":{"href":"https://github.com/django/django/pull/5123"},"issue":{"href":"https://api.github.com/repos/django/django/issues/5123"},"comments":{"href":"https://api.github.com/repos/django/django/issues/5123/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/5123/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/5123/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/48a53bd6a87f887a1d5c766565156985bd11e037"}}}}