Django 1.9 compatibility
- Remove deprecated `load ur from future` - Refactor urls.py as list
This commit is contained in:
parent
c3e47ba438
commit
8ee28118fe
10 changed files with 21 additions and 27 deletions
|
@ -1,10 +1,11 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
{% load staticfiles %}
|
||||||
|
|
||||||
{% block extrahead %}
|
{% block extrahead %}
|
||||||
<!-- CSS and JavaScript for django-todo -->
|
<!-- 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">
|
<script type="text/javascript" charset="utf-8">
|
||||||
// thedate.x comes from the edit_task view. If this is a new entry,
|
// thedate.x comes from the edit_task view. If this is a new entry,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load url from future %}
|
|
||||||
|
|
||||||
{% block title %}{{ list_title }} to-do items{% endblock %}
|
{% block title %}{{ list_title }} to-do items{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
{% load url from future %}
|
|
||||||
Dear {{ task.assigned_to.first_name }} -
|
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 }}:
|
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 }}:
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
{% load url from future %}
|
|
||||||
A new task comment has been added.
|
A new task comment has been added.
|
||||||
|
|
||||||
Task: {{ task.title }}
|
Task: {{ task.title }}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{% extends "todo/base.html" %}
|
{% extends "todo/base.html" %}
|
||||||
{% load url from future %}
|
|
||||||
|
|
||||||
{% block title %}{{ list_title }} Todo Lists{% endblock %}
|
{% block title %}{{ list_title }} Todo Lists{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{% extends "todo/base.html" %}
|
{% extends "todo/base.html" %}
|
||||||
{% load url from future %}
|
|
||||||
|
|
||||||
{% block title %}Search results{% endblock %}
|
{% block title %}Search results{% endblock %}
|
||||||
{% block body_id %}post_search{% endblock %}
|
{% block body_id %}post_search{% endblock %}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{% extends "todo/base.html" %}
|
{% extends "todo/base.html" %}
|
||||||
{% load url from future %}
|
|
||||||
|
|
||||||
{% block title %}Todo List: {{ list.name }}{% endblock %}
|
{% block title %}Todo List: {{ list.name }}{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{% extends "todo/base.html" %}
|
{% extends "todo/base.html" %}
|
||||||
{% load url from future %}
|
|
||||||
|
|
||||||
{% block title %}Task: {{ task.title }}{% endblock %}
|
{% block title %}Task: {{ task.title }}{% endblock %}
|
||||||
|
|
||||||
|
|
34
todo/urls.py
34
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(
|
urlpatterns = [
|
||||||
'',
|
url(r'^$', views.list_lists, name="todo-lists"),
|
||||||
url(r'^$', 'todo.views.list_lists', name="todo-lists"),
|
url(r'^mine/$', views.view_list, {'list_slug': 'mine'}, name="todo-mine"),
|
||||||
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$', views.del_list, name="todo-del_list"),
|
||||||
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})$', views.view_task, name='todo-task_detail'),
|
||||||
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-]+)$', views.view_list, name='todo-incomplete_tasks'),
|
||||||
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$', views.view_list, {'view_completed': 1},
|
||||||
url(r'^(?P<list_id>\d{1,4})/(?P<list_slug>[\w-]+)/completed$', 'todo.views.view_list', {'view_completed': 1},
|
|
||||||
name='todo-completed_tasks'),
|
name='todo-completed_tasks'),
|
||||||
url(r'^add_list/$', 'todo.views.add_list', name="todo-add_list"),
|
url(r'^add_list/$', views.add_list, name="todo-add_list"),
|
||||||
url(r'^search-post/$', 'todo.views.search_post', name="todo-search-post"),
|
url(r'^search-post/$', views.search_post, name="todo-search-post"),
|
||||||
url(r'^search/$', 'todo.views.search', name="todo-search"),
|
url(r'^search/$', views.search, name="todo-search"),
|
||||||
|
|
||||||
# View reorder_tasks is only called by JQuery for drag/drop task ordering
|
# 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'^ticket/add/$', 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/added/$', 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'^recent/completed/$', views.view_list, {'list_slug': 'recent-complete'},
|
||||||
name="todo-recently_completed"),
|
name="todo-recently_completed"),
|
||||||
)
|
]
|
||||||
|
|
|
@ -52,7 +52,7 @@ def list_lists(request):
|
||||||
if request.user.is_superuser:
|
if request.user.is_superuser:
|
||||||
list_list = List.objects.all().order_by('group', 'name')
|
list_list = List.objects.all().order_by('group', 'name')
|
||||||
else:
|
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
|
# Count everything
|
||||||
list_count = list_list.count()
|
list_count = list_list.count()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue