aboutsummaryrefslogtreecommitdiff
path: root/snakeplan
diff options
context:
space:
mode:
authorChris Miller <christopher@ctmiller.net>2010-02-19 22:34:36 -0500
committerChris Miller <christopher@ctmiller.net>2010-02-19 22:34:36 -0500
commit48ec7d720e9b81e7aa849587bef3a263bac2e8ca (patch)
treeed44303a9fcfd8fa15a20bcab14deed1e7b1cd41 /snakeplan
downloadsnakeplan-48ec7d720e9b81e7aa849587bef3a263bac2e8ca.tar.bz2
snakeplan-48ec7d720e9b81e7aa849587bef3a263bac2e8ca.tar.xz
snakeplan-48ec7d720e9b81e7aa849587bef3a263bac2e8ca.zip
Initial check for iterations. YMMV.
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
-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.py4
-rwxr-xr-xsnakeplan/settings.py55
-rw-r--r--snakeplan/snakeplan.dbbin0 -> 86016 bytes
-rwxr-xr-xsnakeplan/urls.py10
14 files changed, 218 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/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..2386d33
--- /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 ('^$', 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..189362a
--- /dev/null
+++ b/snakeplan/projects/views/iterations.py
@@ -0,0 +1,4 @@
1from django.http import HttpResponse
2
3def iteration_list(request):
4 return HttpResponse("Hello world")
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..aa18c45
--- /dev/null
+++ b/snakeplan/urls.py
@@ -0,0 +1,10 @@
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/iterations/', include('snakeplan.projects.urls')),
9 (r'^admin/', include(admin.site.urls)),
10)