aboutsummaryrefslogtreecommitdiff
path: root/snakeplan/projects/views/project.py
diff options
context:
space:
mode:
Diffstat (limited to 'snakeplan/projects/views/project.py')
-rw-r--r--snakeplan/projects/views/project.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/snakeplan/projects/views/project.py b/snakeplan/projects/views/project.py
new file mode 100644
index 0000000..29f037f
--- /dev/null
+++ b/snakeplan/projects/views/project.py
@@ -0,0 +1,49 @@
1# vim: set filencoding=utf8
2"""
3Project Views
4
5@author: Mike Crute (mcrute@gmail.com)
6@organization: SoftGroup Interactive, Inc.
7@date: July 10, 2010
8"""
9
10# Licensed under the Apache License, Version 2.0 (the "License");
11# you may not use this file except in compliance with the License.
12# You may obtain a copy of the License at
13#
14# http://www.apache.org/licenses/LICENSE-2.0
15#
16# Unless required by applicable law or agreed to in writing, software
17# distributed under the License is distributed on an "AS IS" BASIS,
18# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19# See the License for the specific language governing permissions and
20# limitations under the License.
21
22from django.views.generic import list_detail, create_update
23from django.core.urlresolvers import reverse
24
25from projects.models import Project, Iteration
26
27
28def index(request):
29 return list_detail.object_list(request,
30 queryset=Project.objects.order_by('-active', 'name').all())
31
32
33def project_iterations(request, project_id):
34 project = Project.objects.get(id=project_id)
35
36 return list_detail.object_list(request,
37 extra_context={'project_name': project.name },
38 queryset=project.iteration_set.all())
39
40
41def create_project(request):
42 return create_update.create_object(request, model=Project,
43 post_save_redirect=reverse('project-list'))
44
45
46def update_project(request, project_id):
47 return create_update.update_object(request, model=Project,
48 object_id=project_id,
49 post_save_redirect=reverse('project-list'))