diff options
-rw-r--r-- | snakeplan/data.json | 1 | ||||
-rwxr-xr-x | snakeplan/projects/models.py | 8 | ||||
-rw-r--r-- | snakeplan/projects/templates/iteration_list.html | 21 | ||||
-rw-r--r-- | snakeplan/projects/templates/iterations/iteration_list.html | 9 | ||||
-rw-r--r-- | snakeplan/projects/templates/projects/project_list.html | 7 | ||||
-rw-r--r-- | snakeplan/projects/templates/stories/story_list.html | 0 | ||||
-rw-r--r-- | snakeplan/projects/urls.py | 3 | ||||
-rw-r--r-- | snakeplan/projects/views/iterations.py | 12 | ||||
-rw-r--r-- | snakeplan/projects/views/projects.py | 10 | ||||
-rw-r--r-- | snakeplan/projects/views/stories.py | 11 | ||||
-rw-r--r-- | snakeplan/readme_urls.txt | 42 | ||||
-rw-r--r-- | snakeplan/snakeplan.db | bin | 86016 -> 83968 bytes | |||
-rwxr-xr-x | snakeplan/urls.py | 57 |
13 files changed, 100 insertions, 81 deletions
diff --git a/snakeplan/data.json b/snakeplan/data.json new file mode 100644 index 0000000..89b1e1d --- /dev/null +++ b/snakeplan/data.json | |||
@@ -0,0 +1 @@ | |||
[{"pk": 22, "model": "auth.permission", "fields": {"codename": "add_logentry", "name": "Can add log entry", "content_type": 8}}, {"pk": 23, "model": "auth.permission", "fields": {"codename": "change_logentry", "name": "Can change log entry", "content_type": 8}}, {"pk": 24, "model": "auth.permission", "fields": {"codename": "delete_logentry", "name": "Can delete log entry", "content_type": 8}}, {"pk": 4, "model": "auth.permission", "fields": {"codename": "add_group", "name": "Can add group", "content_type": 2}}, {"pk": 10, "model": "auth.permission", "fields": {"codename": "add_message", "name": "Can add message", "content_type": 4}}, {"pk": 1, "model": "auth.permission", "fields": {"codename": "add_permission", "name": "Can add permission", "content_type": 1}}, {"pk": 7, "model": "auth.permission", "fields": {"codename": "add_user", "name": "Can add user", "content_type": 3}}, {"pk": 5, "model": "auth.permission", "fields": {"codename": "change_group", "name": "Can change group", "content_type": 2}}, {"pk": 11, "model": "auth.permission", "fields": {"codename": "change_message", "name": "Can change message", "content_type": 4}}, {"pk": 2, "model": "auth.permission", "fields": {"codename": "change_permission", "name": "Can change permission", "content_type": 1}}, {"pk": 8, "model": "auth.permission", "fields": {"codename": "change_user", "name": "Can change user", "content_type": 3}}, {"pk": 6, "model": "auth.permission", "fields": {"codename": "delete_group", "name": "Can delete group", "content_type": 2}}, {"pk": 12, "model": "auth.permission", "fields": {"codename": "delete_message", "name": "Can delete message", "content_type": 4}}, {"pk": 3, "model": "auth.permission", "fields": {"codename": "delete_permission", "name": "Can delete permission", "content_type": 1}}, {"pk": 9, "model": "auth.permission", "fields": {"codename": "delete_user", "name": "Can delete user", "content_type": 3}}, {"pk": 13, "model": "auth.permission", "fields": {"codename": "add_contenttype", "name": "Can add content type", "content_type": 5}}, {"pk": 14, "model": "auth.permission", "fields": {"codename": "change_contenttype", "name": "Can change content type", "content_type": 5}}, {"pk": 15, "model": "auth.permission", "fields": {"codename": "delete_contenttype", "name": "Can delete content type", "content_type": 5}}, {"pk": 28, "model": "auth.permission", "fields": {"codename": "add_iteration", "name": "Can add iteration", "content_type": 10}}, {"pk": 37, "model": "auth.permission", "fields": {"codename": "add_loggedtime", "name": "Can add logged time", "content_type": 13}}, {"pk": 25, "model": "auth.permission", "fields": {"codename": "add_project", "name": "Can add project", "content_type": 9}}, {"pk": 31, "model": "auth.permission", "fields": {"codename": "add_story", "name": "Can add story", "content_type": 11}}, {"pk": 34, "model": "auth.permission", "fields": {"codename": "add_task", "name": "Can add task", "content_type": 12}}, {"pk": 29, "model": "auth.permission", "fields": {"codename": "change_iteration", "name": "Can change iteration", "content_type": 10}}, {"pk": 38, "model": "auth.permission", "fields": {"codename": "change_loggedtime", "name": "Can change logged time", "content_type": 13}}, {"pk": 26, "model": "auth.permission", "fields": {"codename": "change_project", "name": "Can change project", "content_type": 9}}, {"pk": 32, "model": "auth.permission", "fields": {"codename": "change_story", "name": "Can change story", "content_type": 11}}, {"pk": 35, "model": "auth.permission", "fields": {"codename": "change_task", "name": "Can change task", "content_type": 12}}, {"pk": 30, "model": "auth.permission", "fields": {"codename": "delete_iteration", "name": "Can delete iteration", "content_type": 10}}, {"pk": 39, "model": "auth.permission", "fields": {"codename": "delete_loggedtime", "name": "Can delete logged time", "content_type": 13}}, {"pk": 27, "model": "auth.permission", "fields": {"codename": "delete_project", "name": "Can delete project", "content_type": 9}}, {"pk": 33, "model": "auth.permission", "fields": {"codename": "delete_story", "name": "Can delete story", "content_type": 11}}, {"pk": 36, "model": "auth.permission", "fields": {"codename": "delete_task", "name": "Can delete task", "content_type": 12}}, {"pk": 16, "model": "auth.permission", "fields": {"codename": "add_session", "name": "Can add session", "content_type": 6}}, {"pk": 17, "model": "auth.permission", "fields": {"codename": "change_session", "name": "Can change session", "content_type": 6}}, {"pk": 18, "model": "auth.permission", "fields": {"codename": "delete_session", "name": "Can delete session", "content_type": 6}}, {"pk": 19, "model": "auth.permission", "fields": {"codename": "add_site", "name": "Can add site", "content_type": 7}}, {"pk": 20, "model": "auth.permission", "fields": {"codename": "change_site", "name": "Can change site", "content_type": 7}}, {"pk": 21, "model": "auth.permission", "fields": {"codename": "delete_site", "name": "Can delete site", "content_type": 7}}, {"pk": 1, "model": "auth.user", "fields": {"username": "root", "first_name": "", "last_name": "", "is_active": true, "is_superuser": true, "is_staff": true, "last_login": "2010-02-20 11:18:45", "groups": [], "user_permissions": [], "password": "sha1$f2493$0f7b2e4387894d47810c9c885d9efc9b9043a6c7", "email": "root@example.com", "date_joined": "2010-02-20 11:18:22"}}, {"pk": 5, "model": "contenttypes.contenttype", "fields": {"model": "contenttype", "name": "content type", "app_label": "contenttypes"}}, {"pk": 2, "model": "contenttypes.contenttype", "fields": {"model": "group", "name": "group", "app_label": "auth"}}, {"pk": 10, "model": "contenttypes.contenttype", "fields": {"model": "iteration", "name": "iteration", "app_label": "projects"}}, {"pk": 8, "model": "contenttypes.contenttype", "fields": {"model": "logentry", "name": "log entry", "app_label": "admin"}}, {"pk": 13, "model": "contenttypes.contenttype", "fields": {"model": "loggedtime", "name": "logged time", "app_label": "projects"}}, {"pk": 4, "model": "contenttypes.contenttype", "fields": {"model": "message", "name": "message", "app_label": "auth"}}, {"pk": 1, "model": "contenttypes.contenttype", "fields": {"model": "permission", "name": "permission", "app_label": "auth"}}, {"pk": 9, "model": "contenttypes.contenttype", "fields": {"model": "project", "name": "project", "app_label": "projects"}}, {"pk": 6, "model": "contenttypes.contenttype", "fields": {"model": "session", "name": "session", "app_label": "sessions"}}, {"pk": 7, "model": "contenttypes.contenttype", "fields": {"model": "site", "name": "site", "app_label": "sites"}}, {"pk": 11, "model": "contenttypes.contenttype", "fields": {"model": "story", "name": "story", "app_label": "projects"}}, {"pk": 12, "model": "contenttypes.contenttype", "fields": {"model": "task", "name": "task", "app_label": "projects"}}, {"pk": 3, "model": "contenttypes.contenttype", "fields": {"model": "user", "name": "user", "app_label": "auth"}}, {"pk": "8b4e9c8d3c261624901394dd2613bde4", "model": "sessions.session", "fields": {"expire_date": "2010-03-06 11:18:45", "session_data": "gAJ9cQEoVRJfYXV0aF91c2VyX2JhY2tlbmRxAlUpZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5k\ncy5Nb2RlbEJhY2tlbmRxA1UNX2F1dGhfdXNlcl9pZHEESwF1LjZjMTMyZDUxODcwZTdhZGExZTM4\nNTE0YWY1OWI0MmI4\n"}}, {"pk": 1, "model": "sites.site", "fields": {"domain": "example.com", "name": "example.com"}}, {"pk": 3, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2010-02-20 11:21:35", "object_repr": "Release 0.1", "object_id": "2", "change_message": "", "user": 1, "content_type": 10}}, {"pk": 2, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2010-02-20 11:21:09", "object_repr": "Backlog", "object_id": "1", "change_message": "", "user": 1, "content_type": 10}}, {"pk": 1, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2010-02-20 11:20:47", "object_repr": "Snakeplan", "object_id": "1", "change_message": "", "user": 1, "content_type": 9}}, {"pk": 1, "model": "projects.project", "fields": {"active": true, "hidden": false, "name": "Snakeplan", "wiki_link": "", "description": "Development of snakeplan."}}, {"pk": 1, "model": "projects.iteration", "fields": {"status": 0, "name": "Backlog", "end_date": "2025-02-20", "project": 1, "days_worked": "0", "start_date": "2010-02-20", "description": ""}}, {"pk": 2, "model": "projects.iteration", "fields": {"status": 0, "name": "Release 0.1", "end_date": "2010-03-20", "project": 1, "days_worked": "0", "start_date": "2010-02-20", "description": ""}}] | |||
diff --git a/snakeplan/projects/models.py b/snakeplan/projects/models.py index b91ec7c..857403e 100755 --- a/snakeplan/projects/models.py +++ b/snakeplan/projects/models.py | |||
@@ -53,11 +53,11 @@ class Iteration(Model): | |||
53 | class Story(Model): | 53 | class Story(Model): |
54 | 54 | ||
55 | name = m.CharField(max_length=200) | 55 | name = m.CharField(max_length=200) |
56 | project = m.ForeignKey(Project) | 56 | iteration = m.ForeignKey(Iteration) |
57 | iteration = m.ForeignKey(Iteration, blank=True) | ||
58 | disposition = m.IntegerField(choices=DISPOSITIONS) | 57 | disposition = m.IntegerField(choices=DISPOSITIONS) |
59 | customer = m.ForeignKey(User, blank=True, related_name='story_customer') | 58 | customer = m.ForeignKey(User, blank=True, null=True, |
60 | tracker = m.ForeignKey(User, blank=True) | 59 | related_name='story_customer') |
60 | tracker = m.ForeignKey(User, blank=True, null=True) | ||
61 | status = m.IntegerField(choices=STATUSES, default=0) | 61 | status = m.IntegerField(choices=STATUSES, default=0) |
62 | priority = m.IntegerField() | 62 | priority = m.IntegerField() |
63 | order = m.IntegerField() | 63 | order = m.IntegerField() |
diff --git a/snakeplan/projects/templates/iteration_list.html b/snakeplan/projects/templates/iteration_list.html index 55bad08..4b92f71 100644 --- a/snakeplan/projects/templates/iteration_list.html +++ b/snakeplan/projects/templates/iteration_list.html | |||
@@ -1,18 +1,9 @@ | |||
1 | <h1>{{project_name}}</h1> | 1 | <h1>Project: {{project_name}}</h1> |
2 | 2 | ||
3 | 3 | <h2>Iterations</h2> | |
4 | {% for item in iteration_list %} | 4 | <ul> |
5 | <div id="{{item.id}}"> | 5 | {% for iteration in iterations %} |
6 | <ul> | 6 | <li><a href="/iteration/{{iteration.id}}">{{iteration.name}}</a></li> |
7 | <li><a href="{{item.id}}">{{ item.name }}</a></li> | ||
8 | <li>{{ item.description }}</li> | ||
9 | <li>{{ item.status }}</li> | ||
10 | <li>{{ item.start_date }}</li> | ||
11 | <li>{{ item.end_date }}</li> | ||
12 | <li>{{ item.days_worked }}</li> | ||
13 | </ul> | ||
14 | </div> | ||
15 | {% endfor %} | 7 | {% endfor %} |
16 | </ul> | 8 | </ul> |
17 | 9 | </ul> | |
18 | |||
diff --git a/snakeplan/projects/templates/iterations/iteration_list.html b/snakeplan/projects/templates/iterations/iteration_list.html new file mode 100644 index 0000000..4b92f71 --- /dev/null +++ b/snakeplan/projects/templates/iterations/iteration_list.html | |||
@@ -0,0 +1,9 @@ | |||
1 | <h1>Project: {{project_name}}</h1> | ||
2 | |||
3 | <h2>Iterations</h2> | ||
4 | <ul> | ||
5 | {% for iteration in iterations %} | ||
6 | <li><a href="/iteration/{{iteration.id}}">{{iteration.name}}</a></li> | ||
7 | {% endfor %} | ||
8 | </ul> | ||
9 | </ul> | ||
diff --git a/snakeplan/projects/templates/projects/project_list.html b/snakeplan/projects/templates/projects/project_list.html new file mode 100644 index 0000000..5ede56e --- /dev/null +++ b/snakeplan/projects/templates/projects/project_list.html | |||
@@ -0,0 +1,7 @@ | |||
1 | <h1>Projects</h1> | ||
2 | |||
3 | <ol> | ||
4 | {% for project in object_list %} | ||
5 | <li><a href="{{project.id}}">{{project.name}}</a></li> | ||
6 | {% endfor %} | ||
7 | </ol> | ||
diff --git a/snakeplan/projects/templates/stories/story_list.html b/snakeplan/projects/templates/stories/story_list.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/snakeplan/projects/templates/stories/story_list.html | |||
diff --git a/snakeplan/projects/urls.py b/snakeplan/projects/urls.py index 2b41a8c..703af8f 100644 --- a/snakeplan/projects/urls.py +++ b/snakeplan/projects/urls.py | |||
@@ -2,6 +2,7 @@ from django.conf.urls.defaults import patterns | |||
2 | 2 | ||
3 | 3 | ||
4 | urlpatterns = patterns('snakeplan.projects.views', | 4 | urlpatterns = patterns('snakeplan.projects.views', |
5 | ('^(.*)/', 'iterations.iteration_list'), | 5 | (r'^$', 'projects.index'), |
6 | (r'^story/(.*)/', 'stories.index'), | 6 | (r'^story/(.*)/', 'stories.index'), |
7 | (r'^(.*)/', 'iterations.iteration_list'), | ||
7 | ) | 8 | ) |
diff --git a/snakeplan/projects/views/iterations.py b/snakeplan/projects/views/iterations.py index 327de82..d44fec5 100644 --- a/snakeplan/projects/views/iterations.py +++ b/snakeplan/projects/views/iterations.py | |||
@@ -1,11 +1,11 @@ | |||
1 | from django.shortcuts import render_to_response | 1 | from django.shortcuts import render_to_response |
2 | from projects.models import Project, Iteration | 2 | from snakeplan.projects.models import Project, Iteration |
3 | 3 | ||
4 | def iteration_list(request, project_id): | 4 | def iteration_list(request, project_id): |
5 | project = Project.objects.filter(id = project_id) | 5 | iterations = Iteration.objects.filter(project=project_id) |
6 | iteration_list = Iteration.objects.filter(project = project_id) | 6 | project = iterations[0].project |
7 | 7 | ||
8 | return render_to_response("iteration_list.html", | 8 | return render_to_response("iterations/iteration_list.html", |
9 | {"project_name" : project[0].name, | 9 | {"project_name" : project.name, |
10 | "iteration_list" : iteration_list | 10 | "iterations" : iterations, |
11 | }) | 11 | }) |
diff --git a/snakeplan/projects/views/projects.py b/snakeplan/projects/views/projects.py new file mode 100644 index 0000000..288083e --- /dev/null +++ b/snakeplan/projects/views/projects.py | |||
@@ -0,0 +1,10 @@ | |||
1 | from django.views.generic import list_detail | ||
2 | from snakeplan.projects.models import Project | ||
3 | |||
4 | |||
5 | def index(request): | ||
6 | return list_detail.object_list( | ||
7 | request=request, | ||
8 | queryset=Project.objects.all(), | ||
9 | allow_empty=True | ||
10 | ) | ||
diff --git a/snakeplan/projects/views/stories.py b/snakeplan/projects/views/stories.py index ce59b1e..f87bb2b 100644 --- a/snakeplan/projects/views/stories.py +++ b/snakeplan/projects/views/stories.py | |||
@@ -1,5 +1,10 @@ | |||
1 | from django.http import HttpResponse | 1 | from django.views.generic import list_detail |
2 | from snakeplan.projects.models import Iteration | ||
2 | 3 | ||
3 | 4 | ||
4 | def index(request): | 5 | def index(request, project_id): |
5 | return HttpResponse('Index') | 6 | return list_detail.object_list( |
7 | request=request, | ||
8 | queryset=Iteration.objects.filter(project=project_id).all(), | ||
9 | allow_empty=True | ||
10 | ) | ||
diff --git a/snakeplan/readme_urls.txt b/snakeplan/readme_urls.txt new file mode 100644 index 0000000..6a12fc1 --- /dev/null +++ b/snakeplan/readme_urls.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | ====== ======================== ======================================== | ||
2 | Method URL What it does | ||
3 | ====== ======================== ======================================== | ||
4 | GET /modelname/ Lists model instances, using filters | ||
5 | like ?key=value1&key=value2 | ||
6 | |||
7 | GET /modelname/search displays a search form | ||
8 | |||
9 | GET /modelname/id displays a readonly instance | ||
10 | |||
11 | GET /modelname/edit/id displays an edit form | ||
12 | |||
13 | POST /modelname/update/id updates an instance and redirects | ||
14 | |||
15 | POST /modelname/upsert Updates or inserts an instance and | ||
16 | redirects | ||
17 | |||
18 | GET /modelname/upsert Draws a form to do an upsert. | ||
19 | |||
20 | GET /modelname/upsertform Draws a form to do an upsert. | ||
21 | |||
22 | GET /modelname/create displays an insert form | ||
23 | |||
24 | GET /modelname/insertform displays an insert form | ||
25 | |||
26 | GET /modelname/remove/id displays a form that posts to | ||
27 | /model/delete/id | ||
28 | |||
29 | POST /modelname/insert inserts a new record and redirects | ||
30 | |||
31 | POST /modelname/delete/id deletes a record and redirects | ||
32 | |||
33 | GET /modelname/bulk/edit display a bulk edit ui | ||
34 | |||
35 | POST /modelname/bulk/update performs a bulk update and redirect | ||
36 | |||
37 | GET /modelname/bulk/create display a bulk insert form | ||
38 | |||
39 | POST /modelname/bulk/insert performs a bulk insert and redirect | ||
40 | |||
41 | POST /modelname/bulk/delete performs a bulk delete and redirect | ||
42 | ====== ======================== ======================================== | ||
diff --git a/snakeplan/snakeplan.db b/snakeplan/snakeplan.db index a572f4b..e06dc67 100644 --- a/snakeplan/snakeplan.db +++ b/snakeplan/snakeplan.db | |||
Binary files differ | |||
diff --git a/snakeplan/urls.py b/snakeplan/urls.py index 8a469b2..591c69f 100755 --- a/snakeplan/urls.py +++ b/snakeplan/urls.py | |||
@@ -1,60 +1,13 @@ | |||
1 | from django.contrib import admin | ||
2 | from django.conf.urls.defaults import patterns, include | 1 | from django.conf.urls.defaults import patterns, include |
3 | 2 | ||
3 | from django.contrib import admin | ||
4 | admin.autodiscover() | ||
5 | |||
4 | # Just get the admin stuff, don't actually do anything with it | 6 | # Just get the admin stuff, don't actually do anything with it |
5 | from snakeplan.projects import admin as snakeplan_admin | 7 | from snakeplan.projects import admin as snakeplan_admin |
6 | 8 | ||
7 | 9 | ||
8 | admin.autodiscover() | ||
9 | |||
10 | |||
11 | urlpatterns = patterns('', | 10 | urlpatterns = patterns('', |
12 | (r'^admin/', include(admin.site.urls)), | 11 | (r'^admin/', include('django.contrib.admin.site.urls')), |
13 | (r'^projects/', include('snakeplan.projects.urls')), | 12 | (r'^project/', include('snakeplan.projects.urls')), |
14 | ) | 13 | ) |
15 | |||
16 | |||
17 | """ | ||
18 | ====== ======================== ======================================== | ||
19 | Method URL What it does | ||
20 | ====== ======================== ======================================== | ||
21 | GET /modelname/ Lists model instances, using filters | ||
22 | like ?key=value1&key=value2 | ||
23 | |||
24 | GET /modelname/search displays a search form | ||
25 | |||
26 | GET /modelname/id displays a readonly instance | ||
27 | |||
28 | GET /modelname/edit/id displays an edit form | ||
29 | |||
30 | POST /modelname/update/id updates an instance and redirects | ||
31 | |||
32 | POST /modelname/upsert Updates or inserts an instance and | ||
33 | redirects | ||
34 | |||
35 | GET /modelname/upsert Draws a form to do an upsert. | ||
36 | |||
37 | GET /modelname/upsertform Draws a form to do an upsert. | ||
38 | |||
39 | GET /modelname/create displays an insert form | ||
40 | |||
41 | GET /modelname/insertform displays an insert form | ||
42 | |||
43 | GET /modelname/remove/id displays a form that posts to | ||
44 | /model/delete/id | ||
45 | |||
46 | POST /modelname/insert inserts a new record and redirects | ||
47 | |||
48 | POST /modelname/delete/id deletes a record and redirects | ||
49 | |||
50 | GET /modelname/bulk/edit display a bulk edit ui | ||
51 | |||
52 | POST /modelname/bulk/update performs a bulk update and redirect | ||
53 | |||
54 | GET /modelname/bulk/create display a bulk insert form | ||
55 | |||
56 | POST /modelname/bulk/insert performs a bulk insert and redirect | ||
57 | |||
58 | POST /modelname/bulk/delete performs a bulk delete and redirect | ||
59 | ====== ======================== ======================================== | ||
60 | """ | ||