summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornishanth2010-02-04 19:42:35 +0530
committernishanth2010-02-04 19:42:35 +0530
commita09ed0c3a1b8cede8fe8b802597b926e060d136d (patch)
treea3fcf532c8c3c1da8e1a4d29638c3e9583ede82c
parentd405887643230b37fa44f05f61a102580c19d0a5 (diff)
downloadpytask-a09ed0c3a1b8cede8fe8b802597b926e060d136d.tar.gz
pytask-a09ed0c3a1b8cede8fe8b802597b926e060d136d.tar.bz2
pytask-a09ed0c3a1b8cede8fe8b802597b926e060d136d.zip
removed views.py and made it a package. added auth_profile to settings.py
-rw-r--r--settings.py7
-rw-r--r--taskapp/admin.py8
-rw-r--r--taskapp/models.py48
-rw-r--r--taskapp/views.py1
-rw-r--r--taskapp/views/__init__.py1
-rw-r--r--taskapp/views/tasks.py0
-rw-r--r--taskapp/views/users.py1
-rw-r--r--urls.py4
8 files changed, 40 insertions, 30 deletions
diff --git a/settings.py b/settings.py
index 97da483..329f129 100644
--- a/settings.py
+++ b/settings.py
@@ -10,7 +10,7 @@ ADMINS = (
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = '../pytaskDb' # Or path to database file if using sqlite3.
+DATABASE_NAME = '../../pytask.db' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
@@ -48,7 +48,7 @@ MEDIA_URL = ''
ADMIN_MEDIA_PREFIX = '/media/'
# Make this unique, and don't share it with anybody.
-SECRET_KEY = '@7p-w6$99)@&+sp024%is8i=4#62q8*y0xx=5e_z*4h3%@#7u)'
+SECRET_KEY = '#7bo8^p1gc=$85gv09z5d_d9-8xk1p=me7_c^3ito@jjth6^^w'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
@@ -69,6 +69,7 @@ TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
+ './templates',
)
INSTALLED_APPS = (
@@ -79,3 +80,5 @@ INSTALLED_APPS = (
'django.contrib.admin',
'pytask.taskapp',
)
+
+AUTH_PROFILE_MODULE = 'taskapp.models.Profile'
diff --git a/taskapp/admin.py b/taskapp/admin.py
index bb157f4..54dc14c 100644
--- a/taskapp/admin.py
+++ b/taskapp/admin.py
@@ -1,7 +1,11 @@
-from pytask.taskapp.models import Person,Task,Comment,Credit
from django.contrib import admin
-admin.site.register(Person)
+from pytask.taskapp.models.user import Profile
+from pytask.taskapp.models.task import Task
+from pytask.taskapp.models.credit import Credit
+from pytask.taskapp.models.comment import Comment
+
+admin.site.register(Profile)
admin.site.register(Task)
admin.site.register(Comment)
admin.site.register(Credit)
diff --git a/taskapp/models.py b/taskapp/models.py
index 991b9d9..845a686 100644
--- a/taskapp/models.py
+++ b/taskapp/models.py
@@ -6,37 +6,38 @@ RIGHTS_CHOICES = (
("AD", "Admin"),
("MN", "Manager"),
("DV", "Developer"),
- ("MT", "Mentor"),
- ("CT", "Contributor"),
- ("GP", "Public"),)
+ ("CT", "Contributor"),)
STATUS_CHOICES = (
("OP", "Open"),
+ ("LO", "Locked"),
("CL", "Claimed"),
- ("LO", "Locked"),
- ("AS", "Assigned"),)
+ ("AS", "Assigned"),
+ ("RO", "Reopened"),
+ ("CD", "Closed"),
+ ("DL", "Deleted"),
+ ("CM", "Completed"))
IMAGES_DIR = "./images"
UPLOADS_DIR = "./uploads"
-class Person(models.Model):
-#class Person(User):
+class Profile(models.Model):
user = models.ForeignKey(User, unique = True)
aboutme = models.TextField()
- DOB = models.DateField()
+ dob = models.DateField()
gender = models.CharField(max_length = 1, choices = GENDER_CHOICES)
rights = models.CharField(max_length = 2, choices = RIGHTS_CHOICES)
credits = models.PositiveSmallIntegerField()
foss_comm = models.CharField(max_length = 80, blank = True)
- phoneNum = models.CharField(max_length = 15, blank = True)
+ phonenum = models.CharField(max_length = 15, blank = True)
homepage = models.URLField(blank = True)
street = models.CharField(max_length = 80, blank = True)
city = models.CharField(max_length = 25, blank = True)
country = models.CharField(max_length = 25, blank = True)
nick = models.CharField(max_length = 20, blank = True)
- photo = models.ImageField(upload_to = IMAGES_DIR, blank = True)
+# photo = models.ImageField(upload_to = IMAGES_DIR, blank = True)
def __unicode__(self):
return unicode(self.user.username)
@@ -49,18 +50,18 @@ class Task(models.Model):
status = models.CharField(max_length = 2, choices = STATUS_CHOICES)
tags = models.CharField(max_length = 200, blank = True)
- parents = models.ManyToManyField('self', blank = True, related_name = "%(class)s_parents")
+ subs = models.ManyToManyField('self', blank = True, related_name = "%(class)s_parents")
deps = models.ManyToManyField('self', blank = True, related_name = "%(class)s_deps")
credits = models.PositiveSmallIntegerField()
progress = models.PositiveSmallIntegerField()
- mentors = models.ManyToManyField('Person', related_name = "%(class)s_mentors")
- created_by = models.ForeignKey('Person', related_name = "%(class)s_created_by")
- claimed_users = models.ManyToManyField('Person', blank = True, related_name = "%(class)s_claimed_users")
- assigned_users = models.ManyToManyField('Person', blank = True, related_name = "%(class)s_assigned_users")
+ mentors = models.ManyToManyField(User, related_name = "%(class)s_mentors")
+ created_by = models.ForeignKey(User, related_name = "%(class)s_created_by")
+ claimed_users = models.ManyToManyField(User, blank = True, related_name = "%(class)s_claimed_users")
+ assigned_users = models.ManyToManyField(User, blank = True, related_name = "%(class)s_assigned_users")
- creation_date = models.DateField()
+ creation_datetime = models.DateTimeField()
## not yet decided if attribs after this are to be included
## tasktype = "" ## "bugfix"/"enhancement"
@@ -73,11 +74,11 @@ class Comment(models.Model):
task = models.ForeignKey('Task')
data = models.TextField()
- created_by = models.ForeignKey('Person', related_name = "%(class)s_created_by")
- deleted_by = models.ForeignKey('Person', null = True, blank = True, related_name = "%(class)s_deleted_by")
- creation_date = models.DateField()
- deleted = models.BooleanField()
- attachment = models.FileField(upload_to = UPLOADS_DIR, blank = True)
+ created_by = models.ForeignKey(User, related_name = "%(class)s_created_by")
+ creation_datetime = models.DateTimeField()
+# deleted_by = models.ForeignKey(User, null = True, blank = True, related_name = "%(class)s_deleted_by")
+# deleted = models.BooleanField()
+# attachment = models.FileField(upload_to = UPLOADS_DIR, blank = True)
def __unicode__(self):
return unicode(self.task.title)
@@ -85,9 +86,10 @@ class Comment(models.Model):
class Credit(models.Model):
task = models.ForeignKey('Task')
- given_by = models.ForeignKey('Person', related_name = "%(class)s_given_by")
- given_to = models.ForeignKey('Person', related_name = "%(class)s_given_to")
+ given_by = models.ForeignKey(User, related_name = "%(class)s_given_by")
+ given_to = models.ForeignKey(User, related_name = "%(class)s_given_to")
points = models.PositiveSmallIntegerField()
+ given_time = models.DateTimeField()
def __unicode__(self):
return unicode(self.task.title)
diff --git a/taskapp/views.py b/taskapp/views.py
deleted file mode 100644
index 60f00ef..0000000
--- a/taskapp/views.py
+++ /dev/null
@@ -1 +0,0 @@
-# Create your views here.
diff --git a/taskapp/views/__init__.py b/taskapp/views/__init__.py
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/taskapp/views/__init__.py
@@ -0,0 +1 @@
+
diff --git a/taskapp/views/tasks.py b/taskapp/views/tasks.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/taskapp/views/tasks.py
diff --git a/taskapp/views/users.py b/taskapp/views/users.py
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/taskapp/views/users.py
@@ -0,0 +1 @@
+
diff --git a/urls.py b/urls.py
index 25d2f6c..dc8c49f 100644
--- a/urls.py
+++ b/urls.py
@@ -11,7 +11,7 @@ urlpatterns = patterns('',
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
-
- # Uncomment the next line to enable the admin:
+
(r'^admin/', include(admin.site.urls)),
+
)