aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mcrute@gmail.com>2010-02-16 21:35:22 -0500
committerMike Crute <mcrute@gmail.com>2010-02-16 21:35:22 -0500
commit93513c6b3c3af3bb56b8b9eebf967ffc661f9f60 (patch)
treed629fd152b083063fef9c8fc3b748064bc0c7416
downloadsnakeplan-93513c6b3c3af3bb56b8b9eebf967ffc661f9f60.tar.bz2
snakeplan-93513c6b3c3af3bb56b8b9eebf967ffc661f9f60.tar.xz
snakeplan-93513c6b3c3af3bb56b8b9eebf967ffc661f9f60.zip
Initial model layout
-rw-r--r--.hgignore2
-rwxr-xr-xsnakeplan/__init__.py0
-rwxr-xr-xsnakeplan/manage.py11
-rwxr-xr-xsnakeplan/projects/__init__.py0
-rw-r--r--snakeplan/projects/admin.py32
-rwxr-xr-xsnakeplan/projects/models.py80
-rwxr-xr-xsnakeplan/projects/tests.py23
-rwxr-xr-xsnakeplan/projects/views.py1
-rwxr-xr-xsnakeplan/settings.py55
-rw-r--r--snakeplan/snakeplan.dbbin0 -> 86016 bytes
-rwxr-xr-xsnakeplan/urls.py10
11 files changed, 214 insertions, 0 deletions
diff --git a/.hgignore b/.hgignore
new file mode 100644
index 0000000..2c9154d
--- /dev/null
+++ b/.hgignore
@@ -0,0 +1,2 @@
1syntax: glob
2*.pyc
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..bdfbbd3
--- /dev/null
+++ b/snakeplan/projects/admin.py
@@ -0,0 +1,32 @@
1from snakeplan.projects import models
2from django.contrib import admin
3
4
5class ProjectAdmin(admin.ModelAdmin):
6 pass
7
8admin.site.register(models.Project, ProjectAdmin)
9
10
11class IterationAdmin(admin.ModelAdmin):
12 pass
13
14admin.site.register(models.Iteration, IterationAdmin)
15
16
17class StoryAdmin(admin.ModelAdmin):
18 pass
19
20admin.site.register(models.Story, StoryAdmin)
21
22
23class TaskAdmin(admin.ModelAdmin):
24 pass
25
26admin.site.register(models.Task, TaskAdmin)
27
28
29class LoggedTimeAdmin(admin.ModelAdmin):
30 pass
31
32admin.site.register(models.LoggedTime, LoggedTimeAdmin)
diff --git a/snakeplan/projects/models.py b/snakeplan/projects/models.py
new file mode 100755
index 0000000..d02402e
--- /dev/null
+++ b/snakeplan/projects/models.py
@@ -0,0 +1,80 @@
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
36class Iteration(Model):
37
38 name = m.CharField(max_length=200)
39 project = m.ForeignKey(Project)
40 status = m.IntegerField(choices=STATUSES, default=0)
41 start_date = m.DateField()
42 end_date = m.DateField()
43 days_worked = m.DecimalField(default=0, decimal_places=2, max_digits=5)
44 description = m.TextField(blank=True)
45
46
47class Story(Model):
48
49 name = m.CharField(max_length=200)
50 project = m.ForeignKey(Project)
51 iteration = m.ForeignKey(Iteration, blank=True)
52 disposition = m.IntegerField(choices=DISPOSITIONS)
53 customer = m.ForeignKey(User, blank=True, related_name='story_customer')
54 tracker = m.ForeignKey(User, blank=True)
55 status = m.IntegerField(choices=STATUSES, default=0)
56 priority = m.IntegerField()
57 order = m.IntegerField()
58 description = m.TextField(blank=True)
59
60
61class Task(Model):
62
63 name = m.CharField(max_length=200)
64 story = m.ForeignKey(Story)
65 task_type = m.IntegerField(choices=TASK_TYPES)
66 disposition = m.IntegerField(choices=DISPOSITIONS)
67 acceptor = m.ForeignKey(User, blank=True)
68 estimated_hours = m.DecimalField(decimal_places=2, max_digits=5)
69 description = m.TextField(blank=True)
70
71
72class LoggedTime(Model):
73
74 start_time = m.DateTimeField(blank=True)
75 end_time = m.DateTimeField(blank=True)
76 logged_date = m.DateField()
77 duration = m.DecimalField(decimal_places=2, max_digits=5)
78 person1 = m.ForeignKey(User, blank=True, related_name="person1")
79 person2 = m.ForeignKey(User, blank=True, related_name="person2")
80 description = m.TextField(blank=True)
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/views.py b/snakeplan/projects/views.py
new file mode 100755
index 0000000..60f00ef
--- /dev/null
+++ b/snakeplan/projects/views.py
@@ -0,0 +1 @@
# Create your views here.
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..d2eeedc
--- /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..105045d
--- /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/', include('snakeplan.foo.urls')),
9 (r'^admin/', include(admin.site.urls)),
10)