Mario César Señoranis Ayala avatar Mario César Señoranis Ayala committed d6f1a21

Add empty views and fancy redirect shortcut

Comments (0)

Files changed (9)

djangogtd/gtd/admin.py

     list_display = ('get_name', 'get_context', 'get_project', 'get_progress',
                     'status', 'get_reminders', 'get_created')
     list_display_link = ('get_name', 'status')
-    list_filter = ('context', 'project', 'status', 'deleted', 'archived', )
+    list_filter = ('context', 'project', 'schedule','status', 'deleted', 'archived', )
     list_editable = ('status', )
     search_fields = ['name', 'description']
     inlines = [ReminderInline,]
+    select_related = True
 
     class Media:
         css = {"all": ("admin/css/changelist.css",)}

djangogtd/gtd/urls.py

 from django.conf.urls.defaults import *
 
 urlpatterns = patterns('djangogtd.gtd.views',
-    url(r'^$',                      'dashboard',        name='dashboard'),
-    url(r'^thing/$',                'thing_list',       name='thing_list'),
-    url(r'^thing/(?P<id>\d+)$',     'thing_detail',     name='thing_detail'),     
-    url(r'^context/$',              'context_list',     name='context_list'),
-    url(r'^context/(?P<id>\d+)$',   'context_detail',   name='context_detail'), 
-    url(r'^project/$',              'project_list',     name='project_list'),
-    url(r'^project/(?P<id>\d+)$',   'project_detail',   name='project_detail'),
+    url(r'^$',                      'dashboard.dashboard',      name='dashboard'),
+    url(r'^thing/$',                'objects.thing_list',       name='thing_list'),
+    url(r'^thing/(?P<id>\d+)$',     'objects.thing_detail',     name='thing_detail'),     
+    url(r'^context/$',              'objects.context_list',     name='context_list'),
+    url(r'^context/(?P<id>\d+)$',   'objects.context_detail',   name='context_detail'), 
+    url(r'^project/$',              'objects.project_list',     name='project_list'),
+    url(r'^project/(?P<id>\d+)$',   'objects.project_detail',   name='project_detail'),
 )

djangogtd/gtd/views.py

-from django.shortcuts import render_to_response
-from django.template import RequestContext
-from djangogtd.gtd.models import Thing
-from django.views.generic.list_detail import object_list, object_detail
-
-def render_response(request, template, context=None, mimetype='text/html'):
-    return render_to_response(template, context or {},
-        context_instance=RequestContext(request), mimetype=mimetype)
-    
-def dashboard(request):
-    return render_response(request, 'gtd/dashboard.html')
-
-def thing_list(request):
-    thing_list = Thing.objects.all()
-    return object_list(request, queryset=thing_lists)
-
-def thing_detail(request, id):
-    thing_detail = Thing.objects.get(id)
-    return object_detail(request, queryset=thing_detail)
-
-def context_list(request):
-    context_list = Context.objects.all()
-    return object_list(request, queryset=context_lists)
-
-def context_detail(request, id):
-    context_detail = Context.objects.get(id)
-    return object_detail(request, queryset=context_detail)
-
-def project_list(request):
-    project_list = Project.objects.all()
-    return object_list(request, queryset=project_lists)
-
-def project_detail(request, id):
-    project_detail = Project.objects.get(id)
-    return object_detail(request, queryset=project_detail)
-

djangogtd/gtd/views/__init__.py

+from django.shortcuts import render_to_response
+from django.template import RequestContext
+
+def render_response(request, template, context=None, mimetype='text/html'):
+    return render_to_response(template, context or {},
+        context_instance=RequestContext(request), mimetype=mimetype)
Add a comment to this file

djangogtd/gtd/views/calendar.py

Empty file added.

djangogtd/gtd/views/dashboard.py

+from djangogtd.gtd.views import render_response
+
+def dashboard(request):
+    return render_response(request, 'gtd/dashboard.html')
+

djangogtd/gtd/views/objects.py

+from djangogtd.gtd.models import Thing
+from django.views.generic.list_detail import object_list, object_detail
+
+def thing_list(request):
+    thing_list = Thing.objects.all()
+    return object_list(request, queryset=thing_lists)
+
+def thing_detail(request, id):
+    thing_detail = Thing.objects.get(id)
+    return object_detail(request, queryset=thing_detail)
+
+def context_list(request):
+    context_list = Context.objects.all()
+    return object_list(request, queryset=context_lists)
+
+def context_detail(request, id):
+    context_detail = Context.objects.get(id)
+    return object_detail(request, queryset=context_detail)
+
+def project_list(request):
+    project_list = Project.objects.all()
+    return object_list(request, queryset=project_lists)
+
+def project_detail(request, id):
+    project_detail = Project.objects.get(id)
+    return object_detail(request, queryset=project_detail)
Add a comment to this file

djangogtd/gtd/views/reports.py

Empty file added.

djangogtd/urls.py

 from django.contrib import databrowse
 from django.conf import settings
 from django.contrib.auth.decorators import login_required
+from django.shortcuts import redirect
 
 admin.autodiscover()
 
     (r'^databrowse/(.*)', login_required(databrowse.site.root)),
     (r'^accounts/login/$', 'django.contrib.auth.views.login'),
     (r'^gtd/', include('djangogtd.gtd.urls')),
-    url(r'^$', 'djangogtd.gtd.views.dashboard', name="dashboard"),
+    url(r'^$', lambda request: redirect('/gtd')),
 )
 
 if settings.DEBUG:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.