Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Django 1.9 compatibility
- Remove deprecated `load ur from future`
- Refactor urls.py as list
  • Loading branch information
shacker committed Jan 7, 2016
1 parent c3e47ba commit 8ee2811
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 27 deletions.
5 changes: 3 additions & 2 deletions todo/templates/todo/base.html
@@ -1,10 +1,11 @@
{% extends "base.html" %}
{% load staticfiles %}

{% block extrahead %}
<!-- CSS and JavaScript for django-todo -->
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}todo/css/styles.css" />
<link rel="stylesheet" type="text/css" href="{% static 'todo/css/styles.css' %}" />

<script src="{{STATIC_URL}}todo/js/jquery.tablednd_0_5.js" type="text/javascript"></script>
<script src="{% static 'todo/js/jquery.tablednd_0_5.js' %}" type="text/javascript"></script>

<script type="text/javascript" charset="utf-8">
// thedate.x comes from the edit_task view. If this is a new entry,
Expand Down
1 change: 0 additions & 1 deletion todo/templates/todo/del_list.html
@@ -1,5 +1,4 @@
{% extends "base.html" %}
{% load url from future %}

{% block title %}{{ list_title }} to-do items{% endblock %}

Expand Down
1 change: 0 additions & 1 deletion todo/templates/todo/email/assigned_body.txt
@@ -1,4 +1,3 @@
{% load url from future %}
Dear {{ task.assigned_to.first_name }} -

A new task on the list {{ task.list.name }} has been assigned to you by {{ task.created_by.first_name }} {{ task.created_by.last_name }}:
Expand Down
1 change: 0 additions & 1 deletion todo/templates/todo/email/newcomment_body.txt
@@ -1,4 +1,3 @@
{% load url from future %}
A new task comment has been added.

Task: {{ task.title }}
Expand Down
1 change: 0 additions & 1 deletion todo/templates/todo/list_lists.html
@@ -1,5 +1,4 @@
{% extends "todo/base.html" %}
{% load url from future %}

{% block title %}{{ list_title }} Todo Lists{% endblock %}

Expand Down
1 change: 0 additions & 1 deletion todo/templates/todo/search_results.html
@@ -1,5 +1,4 @@
{% extends "todo/base.html" %}
{% load url from future %}

{% block title %}Search results{% endblock %}
{% block body_id %}post_search{% endblock %}
Expand Down
1 change: 0 additions & 1 deletion todo/templates/todo/view_list.html
@@ -1,5 +1,4 @@
{% extends "todo/base.html" %}
{% load url from future %}

{% block title %}Todo List: {{ list.name }}{% endblock %}

Expand Down
1 change: 0 additions & 1 deletion todo/templates/todo/view_task.html
@@ -1,5 +1,4 @@
{% extends "todo/base.html" %}
{% load url from future %}

{% block title %}Task: {{ task.title }}{% endblock %}

Expand Down
34 changes: 17 additions & 17 deletions todo/urls.py
@@ -1,23 +1,23 @@
from django.conf.urls import patterns, url
from django.conf.urls import url
from todo import views

urlpatterns = patterns(
'',
url(r'^$', 'todo.views.list_lists', name="todo-lists"),
url(r'^mine/$', 'todo.views.view_list', {'list_slug': 'mine'}, name="todo-mine"),
url(r'^(?P<list_id>\d{1,4})/(?P<list_slug>[\w-]+)/delete$', 'todo.views.del_list', name="todo-del_list"),
url(r'^task/(?P<task_id>\d{1,6})$', 'todo.views.view_task', name='todo-task_detail'),
url(r'^(?P<list_id>\d{1,4})/(?P<list_slug>[\w-]+)$', 'todo.views.view_list', name='todo-incomplete_tasks'),
url(r'^(?P<list_id>\d{1,4})/(?P<list_slug>[\w-]+)/completed$', 'todo.views.view_list', {'view_completed': 1},
urlpatterns = [
url(r'^$', views.list_lists, name="todo-lists"),
url(r'^mine/$', views.view_list, {'list_slug': 'mine'}, name="todo-mine"),
url(r'^(?P<list_id>\d{1,4})/(?P<list_slug>[\w-]+)/delete$', views.del_list, name="todo-del_list"),
url(r'^task/(?P<task_id>\d{1,6})$', views.view_task, name='todo-task_detail'),
url(r'^(?P<list_id>\d{1,4})/(?P<list_slug>[\w-]+)$', views.view_list, name='todo-incomplete_tasks'),
url(r'^(?P<list_id>\d{1,4})/(?P<list_slug>[\w-]+)/completed$', views.view_list, {'view_completed': 1},
name='todo-completed_tasks'),
url(r'^add_list/$', 'todo.views.add_list', name="todo-add_list"),
url(r'^search-post/$', 'todo.views.search_post', name="todo-search-post"),
url(r'^search/$', 'todo.views.search', name="todo-search"),
url(r'^add_list/$', views.add_list, name="todo-add_list"),
url(r'^search-post/$', views.search_post, name="todo-search-post"),
url(r'^search/$', views.search, name="todo-search"),

# View reorder_tasks is only called by JQuery for drag/drop task ordering
url(r'^reorder_tasks/$', 'todo.views.reorder_tasks', name="todo-reorder_tasks"),
url(r'^reorder_tasks/$', views.reorder_tasks, name="todo-reorder_tasks"),

url(r'^ticket/add/$', 'todo.views.external_add', name="todo-external-add"),
url(r'^recent/added/$', 'todo.views.view_list', {'list_slug': 'recent-add'}, name="todo-recently_added"),
url(r'^recent/completed/$', 'todo.views.view_list', {'list_slug': 'recent-complete'},
url(r'^ticket/add/$', views.external_add, name="todo-external-add"),
url(r'^recent/added/$', views.view_list, {'list_slug': 'recent-add'}, name="todo-recently_added"),
url(r'^recent/completed/$', views.view_list, {'list_slug': 'recent-complete'},
name="todo-recently_completed"),
)
]
2 changes: 1 addition & 1 deletion todo/views.py
Expand Up @@ -52,7 +52,7 @@ def list_lists(request):
if request.user.is_superuser:
list_list = List.objects.all().order_by('group', 'name')
else:
list_list = List.objects.filter(group__in=request.user.groups.all).order_by('group', 'name')
list_list = List.objects.filter(group__in=request.user.groups.all()).order_by('group', 'name')

# Count everything
list_count = list_list.count()
Expand Down

0 comments on commit 8ee2811

Please sign in to comment.