aboutsummaryrefslogtreecommitdiff
path: root/snakeplan
diff options
context:
space:
mode:
authorChris Miller <christopher@ctmiller.net>2010-02-20 10:59:07 -0500
committerChris Miller <christopher@ctmiller.net>2010-02-20 10:59:07 -0500
commit50083ace2b7ada3a21889b1498399af1c3d8fc2a (patch)
tree8a515f29bb3d5b8156d3f3a55668503d699616ce /snakeplan
downloadsnakeplan-50083ace2b7ada3a21889b1498399af1c3d8fc2a.tar.bz2
snakeplan-50083ace2b7ada3a21889b1498399af1c3d8fc2a.tar.xz
snakeplan-50083ace2b7ada3a21889b1498399af1c3d8fc2a.zip
Basic list of iterations. Needs much much more work.
Diffstat (limited to 'snakeplan')
-rwxr-xr-xsnakeplan/__init__.py0
-rwxr-xr-xsnakeplan/manage.py11
-rwxr-xr-xsnakeplan/projects/__init__.py0
-rw-r--r--snakeplan/projects/admin.py8
-rwxr-xr-xsnakeplan/projects/models.py95
-rw-r--r--snakeplan/projects/templates/footer.html2
-rw-r--r--snakeplan/projects/templates/header.html4
-rw-r--r--snakeplan/projects/templates/iteration_list.html18
-rwxr-xr-xsnakeplan/projects/tests.py23
-rw-r--r--snakeplan/projects/urls.py6
-rw-r--r--snakeplan/projects/views/__init__.py0
-rw-r--r--snakeplan/projects/views/iterations.py11
-rwxr-xr-xsnakeplan/settings.py55
-rw-r--r--snakeplan/snakeplan.dbbin0 -> 86016 bytes
-rwxr-xr-xsnakeplan/urls.py59
15 files changed, 292 insertions, 0 deletions
diff --git a/snakeplan/__init__.py b/snakeplan/__init__.py
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/snakeplan/__init__.py
diff --git a/snakeplan/manage.py b/snakeplan/manage.py
new file mode 100755
index 0000000..5e78ea9
--- /dev/null
+++ b/snakeplan/manage.py
@@ -0,0 +1,11 @@
1#!/usr/bin/env python
2from django.core.management import execute_manager
3try:
4 import settings # Assumed to be in the same directory.
5except ImportError:
6 import sys
7 sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
8 sys.exit(1)
9
10if __name__ == "__main__":
11 execute_manager(settings)
diff --git a/snakeplan/projects/__init__.py b/snakeplan/projects/__init__.py
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/snakeplan/projects/__init__.py
diff --git a/snakeplan/projects/admin.py b/snakeplan/projects/admin.py
new file mode 100644
index 0000000..7471356
--- /dev/null
+++ b/snakeplan/projects/admin.py
@@ -0,0 +1,8 @@
1from snakeplan.projects import models
2from django.contrib import admin
3
4admin.site.register(models.Task)
5admin.site.register(models.Story)
6admin.site.register(models.Project)
7admin.site.register(models.Iteration)
8admin.site.register(models.LoggedTime)
diff --git a/snakeplan/projects/models.py b/snakeplan/projects/models.py
new file mode 100755
index 0000000..b91ec7c
--- /dev/null
+++ b/snakeplan/projects/models.py
@@ -0,0 +1,95 @@
1from django.db import models as m
2from django.db.models import Model
3from django.contrib.auth.models import User
4
5
6STATUSES = (
7 (0, 'Active'),
8 (1, 'Inactive'),
9 )
10
11DISPOSITIONS = (
12 (0, 'Planned'),
13 (1, 'Carried Over'),
14 (2, 'Added'),
15 (3, 'Discovered'),
16 )
17
18TASK_TYPES = (
19 (0, 'Feature'),
20 (1, 'Debt'),
21 (2, 'Functional Test'),
22 (3, 'Acceptance Test'),
23 (4, 'Overhead'),
24 )
25
26
27class Project(Model):
28
29 name = m.CharField(max_length=200)
30 description = m.TextField(blank=True)
31 active = m.BooleanField(default=True)
32 hidden = m.BooleanField(default=False)
33 wiki_link = m.URLField(blank=True)
34
35 def __unicode__(self):
36 return self.name
37
38
39class Iteration(Model):
40
41 name = m.CharField(max_length=200)
42 project = m.ForeignKey(Project)
43 status = m.IntegerField(choices=STATUSES, default=0)
44 start_date = m.DateField()
45 end_date = m.DateField()
46 days_worked = m.DecimalField(default=0, decimal_places=2, max_digits=5)
47 description = m.TextField(blank=True)
48
49 def __unicode__(self):
50 return self.name
51
52
53class Story(Model):
54
55 name = m.CharField(max_length=200)
56 project = m.ForeignKey(Project)
57 iteration = m.ForeignKey(Iteration, blank=True)
58 disposition = m.IntegerField(choices=DISPOSITIONS)
59 customer = m.ForeignKey(User, blank=True, related_name='story_customer')
60 tracker = m.ForeignKey(User, blank=True)
61 status = m.IntegerField(choices=STATUSES, default=0)
62 priority = m.IntegerField()
63 order = m.IntegerField()
64 description = m.TextField(blank=True)
65
66 def __unicode__(self):
67 return self.name
68
69
70class Task(Model):
71
72 name = m.CharField(max_length=200)
73 story = m.ForeignKey(Story)
74 task_type = m.IntegerField(choices=TASK_TYPES)
75 disposition = m.IntegerField(choices=DISPOSITIONS)
76 acceptor = m.ForeignKey(User, blank=True)
77 estimated_hours = m.DecimalField(decimal_places=2, max_digits=5)
78 description = m.TextField(blank=True)
79
80 def __unicode__(self):
81 return self.name
82
83
84class LoggedTime(Model):
85
86 start_time = m.DateTimeField(blank=True)
87 end_time = m.DateTimeField(blank=True)
88 logged_date = m.DateField()
89 duration = m.DecimalField(decimal_places=2, max_digits=5)
90 person1 = m.ForeignKey(User, blank=True, related_name="person1")
91 person2 = m.ForeignKey(User, blank=True, related_name="person2")
92 description = m.TextField(blank=True)
93
94 def __unicode__(self):
95 return self.description
diff --git a/snakeplan/projects/templates/footer.html b/snakeplan/projects/templates/footer.html
new file mode 100644
index 0000000..308b1d0
--- /dev/null
+++ b/snakeplan/projects/templates/footer.html
@@ -0,0 +1,2 @@
1</body>
2</html>
diff --git a/snakeplan/projects/templates/header.html b/snakeplan/projects/templates/header.html
new file mode 100644
index 0000000..75ba4bf
--- /dev/null
+++ b/snakeplan/projects/templates/header.html
@@ -0,0 +1,4 @@
1<html>
2 <head><title>{{page_title]]</title></head>
3
4 <body>
diff --git a/snakeplan/projects/templates/iteration_list.html b/snakeplan/projects/templates/iteration_list.html
new file mode 100644
index 0000000..55bad08
--- /dev/null
+++ b/snakeplan/projects/templates/iteration_list.html
@@ -0,0 +1,18 @@
1<h1>{{project_name}}</h1>
2
3
4{% for item in iteration_list %}
5<div id="{{item.id}}">
6 <ul>
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 %}
16</ul>
17
18
diff --git a/snakeplan/projects/tests.py b/snakeplan/projects/tests.py
new file mode 100755
index 0000000..2247054
--- /dev/null
+++ b/snakeplan/projects/tests.py
@@ -0,0 +1,23 @@
1"""
2This file demonstrates two different styles of tests (one doctest and one
3unittest). These will both pass when you run "manage.py test".
4
5Replace these with more appropriate tests for your application.
6"""
7
8from django.test import TestCase
9
10class SimpleTest(TestCase):
11 def test_basic_addition(self):
12 """
13 Tests that 1 + 1 always equals 2.
14 """
15 self.failUnlessEqual(1 + 1, 2)
16
17__test__ = {"doctest": """
18Another way to test that 1 + 1 is equal to 2.
19
20>>> 1 + 1 == 2
21True
22"""}
23
diff --git a/snakeplan/projects/urls.py b/snakeplan/projects/urls.py
new file mode 100644
index 0000000..cf1f67d
--- /dev/null
+++ b/snakeplan/projects/urls.py
@@ -0,0 +1,6 @@
1from django.conf.urls.defaults import *
2from projects.views.iterations import *
3
4urlpatterns = patterns('',
5 ('^(.*?)/iterations/', iteration_list),
6)
diff --git a/snakeplan/projects/views/__init__.py b/snakeplan/projects/views/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/snakeplan/projects/views/__init__.py
diff --git a/snakeplan/projects/views/iterations.py b/snakeplan/projects/views/iterations.py
new file mode 100644
index 0000000..327de82
--- /dev/null
+++ b/snakeplan/projects/views/iterations.py
@@ -0,0 +1,11 @@
1from django.shortcuts import render_to_response
2from projects.models import Project, Iteration
3
4def iteration_list(request, project_id):
5 project = Project.objects.filter(id = project_id)
6 iteration_list = Iteration.objects.filter(project = project_id)
7
8 return render_to_response("iteration_list.html",
9 {"project_name" : project[0].name,
10 "iteration_list" : iteration_list
11 })
diff --git a/snakeplan/settings.py b/snakeplan/settings.py
new file mode 100755
index 0000000..6da9ec1
--- /dev/null
+++ b/snakeplan/settings.py
@@ -0,0 +1,55 @@
1DEBUG = True
2TEMPLATE_DEBUG = DEBUG
3
4ADMINS = (
5 ('Mike Crute', 'mcrute@gmail.com'),
6)
7
8MANAGERS = ADMINS
9
10DATABASE_ENGINE = 'sqlite3'
11DATABASE_NAME = 'snakeplan.db'
12
13TIME_ZONE = 'America/New_York'
14LANGUAGE_CODE = 'en-us'
15
16SITE_ID = 1
17
18USE_I18N = False
19
20# Absolute path to the directory that holds media.
21# Example: "/home/media/media.lawrence.com/"
22MEDIA_ROOT = ''
23
24# URL that handles the media served from MEDIA_ROOT. Make sure to use a
25# trailing slash if there is a path component (optional in other cases).
26# Examples: "http://media.lawrence.com", "http://example.com/media/"
27MEDIA_URL = ''
28ADMIN_MEDIA_PREFIX = '/media/'
29
30SECRET_KEY = 'ow28jyl#0h8+^3$-!*%o-qfj5#zyr@xz+%vn_a3iizhn%l-3_='
31
32TEMPLATE_LOADERS = (
33 'django.template.loaders.filesystem.load_template_source',
34 'django.template.loaders.app_directories.load_template_source',
35)
36
37MIDDLEWARE_CLASSES = (
38 'django.middleware.common.CommonMiddleware',
39 'django.contrib.sessions.middleware.SessionMiddleware',
40 'django.contrib.auth.middleware.AuthenticationMiddleware',
41)
42
43ROOT_URLCONF = 'snakeplan.urls'
44
45TEMPLATE_DIRS = (
46)
47
48INSTALLED_APPS = (
49 'django.contrib.auth',
50 'django.contrib.contenttypes',
51 'django.contrib.sessions',
52 'django.contrib.sites',
53 'django.contrib.admin',
54 'snakeplan.projects',
55)
diff --git a/snakeplan/snakeplan.db b/snakeplan/snakeplan.db
new file mode 100644
index 0000000..a572f4b
--- /dev/null
+++ b/snakeplan/snakeplan.db
Binary files differ
diff --git a/snakeplan/urls.py b/snakeplan/urls.py
new file mode 100755
index 0000000..d02a714
--- /dev/null
+++ b/snakeplan/urls.py
@@ -0,0 +1,59 @@
1from django.conf.urls.defaults import *
2from django.contrib import admin
3from snakeplan.projects import admin as snakeplan_admin
4
5admin.autodiscover()
6
7urlpatterns = patterns('',
8 (r'^snakeplan/projects/', include('snakeplan.projects.urls')),
9 (r'^admin/', include(admin.site.urls)),
10 #(r'^foo$', 'snakeplan.projects.views.foo'),
11 #(r'^projects$', 'snakeplan.projects.views.foo'),
12)
13
14
15"""
16====== ======================== ========================================
17Method URL What it does
18====== ======================== ========================================
19GET /modelname/ Lists model instances, using filters
20 like ?key=value1&key=value2
21
22GET /modelname/search displays a search form
23
24GET /modelname/id displays a readonly instance
25
26GET /modelname/edit/id displays an edit form
27
28POST /modelname/update/id updates an instance and redirects
29
30POST /modelname/upsert Updates or inserts an instance and
31 redirects
32
33GET /modelname/upsert Draws a form to do an upsert.
34
35GET /modelname/upsertform Draws a form to do an upsert.
36
37GET /modelname/create displays an insert form
38
39GET /modelname/insertform displays an insert form
40
41GET /modelname/remove/id displays a form that posts to
42 /model/delete/id
43
44POST /modelname/insert inserts a new record and redirects
45
46POST /modelname/delete/id deletes a record and redirects
47
48GET /modelname/bulk/edit display a bulk edit ui
49
50POST /modelname/bulk/update performs a bulk update and redirect
51
52GET /modelname/bulk/create display a bulk insert form
53
54POST /modelname/bulk/insert performs a bulk insert and redirect
55
56POST /modelname/bulk/delete performs a bulk delete and redirect
57
58====== ======================== ========================================
59"""