Skip to content
Browse files

updated deprecated functions to Django 1.5

  • Loading branch information...
1 parent ab6d14e commit ac12e684e90d93eb4dd7c21a2e39725faa05727e Matthew Fisher committed Mar 26, 2013
Showing with 14 additions and 12 deletions.
  1. +9 −7 gtd/views/objects.py
  2. +2 −2 templates/gtd/dashboard.html
  3. +3 −3 templates/gtd/thing_list_item.html
View
16 gtd/views/objects.py
@@ -1,26 +1,28 @@
from gtd.models import Thing
-from django.views.generic.list_detail import object_list, object_detail
+from django.views.generic.list import ListView
+from django.views.generic.detail import DetailView
+
def thing_list(request):
thing_list = Thing.objects.all()
- return object_list(request, queryset=thing_lists)
+ return ListView(request, queryset=thing_lists)
def thing_detail(request, id):
thing_detail = Thing.objects.get(id)
- return object_detail(request, queryset=thing_detail)
+ return DetailView(request, queryset=thing_detail)
def context_list(request):
context_list = Context.objects.all()
- return object_list(request, queryset=context_lists)
+ return ListView(request, queryset=context_lists)
def context_detail(request, id):
context_detail = Context.objects.get(id)
- return object_detail(request, queryset=context_detail)
+ return DetailView(request, queryset=context_detail)
def project_list(request):
project_list = Project.objects.all()
- return object_list(request, queryset=project_lists)
+ return ListView(request, queryset=project_lists)
def project_detail(request, id):
project_detail = Project.objects.get(id)
- return object_detail(request, queryset=project_detail)
+ return DetailView(request, queryset=project_detail)
View
4 templates/gtd/dashboard.html
@@ -94,7 +94,7 @@
{% block content %}
{% if context %}
<div id="actions" class="borderradius_10 boxshadow">
- <a href="{% url admin:gtd_thing_add %}?context={{context.id}}">Add thing</a>
+ <a href="{% url "admin:gtd_thing_add" %}?context={{context.id}}">Add thing</a>
</div>
<h1>{{context}}</h1>
<h2>{{context.name}}</h2>
@@ -105,7 +105,7 @@
{% endif %}
{% if project %}
<div id="actions" class="borderradius_10 boxshadow">
- <a href="{% url admin:gtd_thing_add %}?project={{project.id}}">Add thing</a>
+ <a href="{% url "admin:gtd_thing_add" %}?project={{project.id}}">Add thing</a>
</div>
<h1>{{project}}</h1>
<h2>{{project.name}}</h2>
View
6 templates/gtd/thing_list_item.html
@@ -1,7 +1,7 @@
<li class="borderradius_3 boxshadow state_{{thing.status}} deleted_{{thing.deleted|lower}}{% if thing.progress > 0 and not thing.status == thing.STATE_DONE %} progress-thing{% endif %}">
<div class="status_icons">{% include 'gtd/status_icons.html' %}</div>
<div class="context">
- <a href="{% url admin:gtd_context_change thing.context.id %}" class="context_tag borderradius_10">{{thing.context}}</a>
+ <a href="{% url "admin:gtd_context_change" thing.context.id %}" class="context_tag borderradius_10">{{thing.context}}</a>
</div>
<div class="thing-info">
{% if thing.status == thing.STATE_DEFERRED %}
@@ -10,8 +10,8 @@
<div class="day">{{thing.schedule.day|default:"?"}}</div>
</div>
{% endif %}
-<span>{% if thing.project %}<a class="project_tag borderradius_3" href="{% url admin:gtd_project_change thing.project.id %}">{{thing.project}}</a>{% endif %}
-<a href="{% url admin:gtd_thing_change thing.id %}">{{thing.name}}</a></span><br />
+<span>{% if thing.project %}<a class="project_tag borderradius_3" href="{% url "admin:gtd_project_change" thing.project.id %}">{{thing.project}}</a>{% endif %}
+<a href="{% url "admin:gtd_thing_change" thing.id %}">{{thing.name}}</a></span><br />
</div>
{% if thing.progress > 0 and not thing.status == thing.STATE_DONE %}<div class="progress borderradius_3" style="width: {{thing.progress}}%;"></div>{% endif %}
</li>

0 comments on commit ac12e68

Please sign in to comment.
Something went wrong with that request. Please try again.