[Django] #20565: Generic view descriptions should give template examples

2 views
Skip to first unread message

Django

unread,
Jun 5, 2013, 5:16:07 PM6/5/13
to django-...@googlegroups.com
#20565: Generic view descriptions should give template examples
---------------------------------+--------------------
Reporter: david.reitter@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+--------------------
When reading the docs for generic views, I wonder what the templates
should like like.

It does not seem like standard templates are provided (why not?), but as a
minimum, the documentation should give an example of a template for each
view class.

The template variables are idiosyncratic w.r.t. the view class, e.g., the
ListView defines 'object_list' as a variable. So why not give this
template example:


{{{
{% block content %}
<h1>Exams</h1>
<table>
{% for o in object_list %}
<tr><td>{{ o }}</td><td><a href="{% url 'exam_update' o.id
%}">edit</a>&nbsp;&nbsp;<a href="{% url 'exam_delete' o.id
%}">del</a></td></tr>
{% endfor %}
</table>
{% endblock %}
}}}


Right now, I am looking for how to correctly implement the delete
confirmation template.

https://docs.djangoproject.com/en/dev/ref/class-based-views/generic-
editing/#django.views.generic.edit.DeleteView

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

Django

unread,
Jun 6, 2013, 4:08:19 AM6/6/13
to django-...@googlegroups.com
#20565: Generic view descriptions should give template examples
---------------------------------+------------------------------------
Reporter: david.reitter@… | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* cc: bmispelon@… (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
* type: Uncategorized => New feature
* stage: Unreviewed => Accepted


Comment:

Seeing as we're already providing an example `views.py` and `urls.py` for
most views, I think it makes sense to include an example template when it
makes sense.

The only example template I could find was in
https://docs.djangoproject.com/en/1.5/topics/class-based-views/generic-
display/#generic-views-of-objects.

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

Django

unread,
Jun 6, 2013, 10:36:41 AM6/6/13
to django-...@googlegroups.com
#20565: Generic view descriptions should give template examples
---------------------------------+------------------------------------
Reporter: david.reitter@… | Owner: batisteo
Type: New feature | Status: assigned
Component: Documentation | Version: master

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

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

* owner: nobody => batisteo
* cc: batisteo (added)
* status: new => assigned


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

Django

unread,
Jun 14, 2013, 8:25:01 AM6/14/13
to django-...@googlegroups.com
#20565: Generic view descriptions should give template examples
---------------------------------+------------------------------------
Reporter: david.reitter@… | Owner: batisteo
Type: New feature | Status: assigned
Component: Documentation | Version: master

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

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

Comment (by batisteo):

Pull request here: https://github.com/django/django/pull/1271

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

Django

unread,
Jun 14, 2013, 8:25:32 AM6/14/13
to django-...@googlegroups.com
#20565: Generic view descriptions should give template examples
---------------------------------+------------------------------------
Reporter: david.reitter@… | Owner: batisteo
Type: New feature | Status: assigned
Component: Documentation | Version: master

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

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

* has_patch: 0 => 1


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

Django

unread,
Jun 14, 2013, 10:40:15 AM6/14/13
to django-...@googlegroups.com
#20565: Generic view descriptions should give template examples
---------------------------------+------------------------------------
Reporter: david.reitter@… | Owner: batisteo
Type: New feature | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Baptiste Darthenay <baptiste+github@…>):

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


Comment:

In [changeset:"81545940c68de0d1235a2fb50e61b8619f17a3e3"]:
{{{
#!CommitTicketReference repository=""
revision="81545940c68de0d1235a2fb50e61b8619f17a3e3"
Fixed #20565 -- Added template examples for GCBV.

Thanks to David Reitter for the report,
and to Marc Tamlyn and Baptiste Mispelon for the review.
}}}

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

Django

unread,
Jun 14, 2013, 10:40:15 AM6/14/13
to django-...@googlegroups.com
#20565: Generic view descriptions should give template examples
---------------------------------+------------------------------------
Reporter: david.reitter@… | Owner: batisteo
Type: New feature | Status: closed
Component: Documentation | Version: master

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

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

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

In [changeset:"f6567578887b7cc4efb0006ac4a3a5ba7a1c2cc7"]:
{{{
#!CommitTicketReference repository=""
revision="f6567578887b7cc4efb0006ac4a3a5ba7a1c2cc7"
Merge pull request #1271 from batisteo/ticket-20565

Fixed #20565 -- Added template examples for GCBV.
}}}

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

Reply all
Reply to author
Forward
0 new messages