[Django] #23690: Docs for Rendering fields manually <label for="...."> showing static rather than dynamic code

8 views
Skip to first unread message

Django

unread,
Oct 20, 2014, 9:54:16 AM10/20/14
to django-...@googlegroups.com
#23690: Docs for Rendering fields manually <label for="...."> showing static rather
than dynamic code
--------------------------------------+--------------------
Reporter: awidgery | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
See here:

https://docs.djangoproject.com/en/1.7/topics/forms/#rendering-fields-
manually


{{{
<div class="fieldWrapper">
{{ form.subject.errors }}
<label for="id_subject">Email subject:</label>
{{ form.subject }}
</div>
}}}


Wouldn't it be better to show:

{{{
<div class="fieldWrapper">
{{ form.subject.errors }}
<label for="{{ form.subject.auto_id">Email subject:</label>
{{ form.subject }}
</div>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23690>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 20, 2014, 10:00:33 AM10/20/14
to django-...@googlegroups.com
#23690: Docs for Rendering fields manually <label for="...."> showing static rather
than dynamic code
--------------------------------------+------------------------------------

Reporter: awidgery | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0


Old description:

> {{{
> <div class="fieldWrapper">
> {{ form.subject.errors }}
> <label for="id_subject">Email subject:</label>
> {{ form.subject }}
> </div>
> }}}
>

> Wouldn't it be better to show:
>

>
> {{{
> <div class="fieldWrapper">
> {{ form.subject.errors }}
> <label for="{{ form.subject.auto_id">Email subject:</label>
> {{ form.subject }}
> </div>
> }}}

New description:

See here:

https://docs.djangoproject.com/en/1.7/topics/forms/#rendering-fields-
manually


{{{
<div class="fieldWrapper">
{{ form.subject.errors }}
<label for="id_subject">Email subject:</label>
{{ form.subject }}
</div>
}}}


Wouldn't it be better to show:

{{{
<div class="fieldWrapper">
{{ form.subject.errors }}
<label for="{{ form.subject.id_for_label }}">Email subject:</label>
{{ form.subject }}
</div>
}}}

--

Comment:

That seems fine to me. In the ticket you original had `auto_id`, but I
think you meant `id_for_label` so I edited the description. We might also
want to note the alternative of `{{ field.label_tag }}` for that entire
line, presuming you have made all the customizations on the form.

--
Ticket URL: <https://code.djangoproject.com/ticket/23690#comment:1>

Django

unread,
Nov 15, 2014, 2:53:50 AM11/15/14
to django-...@googlegroups.com
#23690: Docs for Rendering fields manually <label for="...."> showing static rather
than dynamic code
--------------------------------------+------------------------------------
Reporter: awidgery | Owner: nmundar
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by nmundar):

* owner: nobody => nmundar
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/23690#comment:2>

Django

unread,
Nov 15, 2014, 7:38:47 AM11/15/14
to django-...@googlegroups.com
#23690: Docs for Rendering fields manually <label for="...."> showing static rather
than dynamic code
--------------------------------------+------------------------------------
Reporter: awidgery | Owner: nmundar
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by nmundar):

I've made a PR here: https://github.com/django/django/pull/3524

--
Ticket URL: <https://code.djangoproject.com/ticket/23690#comment:3>

Django

unread,
Nov 15, 2014, 9:48:23 PM11/15/14
to django-...@googlegroups.com
#23690: Docs for Rendering fields manually <label for="...."> showing static rather
than dynamic code
-------------------------------------+-------------------------------------
Reporter: awidgery | Owner: nmundar
Type: | Status: assigned
Cleanup/optimization | Version: 1.7
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by berkerpeksag):

* has_patch: 0 => 1
* stage: Accepted => Ready for checkin


Comment:

[https://github.com/django/django/pull/3524 PR #3524] LGTM.

--
Ticket URL: <https://code.djangoproject.com/ticket/23690#comment:4>

Django

unread,
Nov 16, 2014, 4:21:19 AM11/16/14
to django-...@googlegroups.com
#23690: Docs for Rendering fields manually <label for="...."> showing static rather
than dynamic code
-------------------------------------+-------------------------------------
Reporter: awidgery | Owner: nmundar
Type: | Status: closed
Cleanup/optimization | Version: 1.7
Component: Documentation | Resolution: fixed

Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Marc Tamlyn <marc.tamlyn@…>):

In [changeset:"d30a131119c34ba166ccb7b01bc6201caa6f0831"]:
{{{
#!CommitTicketReference repository=""
revision="d30a131119c34ba166ccb7b01bc6201caa6f0831"
Merge pull request #3524 from nmundar/ticket_23690

Fixed #23690 - fixed examples of manual rendering of form fields
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23690#comment:6>

Django

unread,
Nov 16, 2014, 4:21:19 AM11/16/14
to django-...@googlegroups.com
#23690: Docs for Rendering fields manually <label for="...."> showing static rather
than dynamic code
-------------------------------------+-------------------------------------
Reporter: awidgery | Owner: nmundar
Type: | Status: closed
Cleanup/optimization | Version: 1.7
Component: Documentation | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by nmundar <neven.mundar@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"48515ee1f7bec437544a0a958332483298f4028b"]:
{{{
#!CommitTicketReference repository=""
revision="48515ee1f7bec437544a0a958332483298f4028b"


Fixed #23690 - fixed examples of manual rendering of form fields

Documentation for rendering form fields manually is now updated to use
fields id_for_label instead of hardcoded values with additional mention of
label_tag for alternative generation of complete label tag.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23690#comment:5>

Django

unread,
Nov 16, 2014, 8:39:07 AM11/16/14
to django-...@googlegroups.com
#23690: Docs for Rendering fields manually <label for="...."> showing static rather
than dynamic code
-------------------------------------+-------------------------------------
Reporter: awidgery | Owner: nmundar
Type: | Status: closed
Cleanup/optimization | Version: 1.7
Component: Documentation | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"b2534bfa7b3b4f9d5e6c4db48556d2ae6ba3b4a9"]:
{{{
#!CommitTicketReference repository=""
revision="b2534bfa7b3b4f9d5e6c4db48556d2ae6ba3b4a9"
[1.7.x] Fixed #23690 - fixed examples of manual rendering of form fields

Documentation for rendering form fields manually is now updated to use
fields id_for_label instead of hardcoded values with additional mention of
label_tag for alternative generation of complete label tag.

Backport of 48515ee1f7bec437544a0a958332483298f4028b from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23690#comment:7>

Reply all
Reply to author
Forward
0 new messages