taskapp/models.py
changeset 51 89463859712c
parent 49 52b774df918e
child 52 0b73f0d8e06e
equal deleted inserted replaced
50:d40e86f958f7 51:89463859712c
     1 from django.db import models
     1 from django.db import models
     2 from django.contrib.auth.models import User
     2 from django.contrib.auth.models import User
     3 import tagging
     3 import tagging
     4 from tagging.fields import TagField
     4 from tagging.fields import TagField
     5 
       
     6 
     5 
     7 GENDER_CHOICES = (( 'M', 'Male'), ('F', 'Female'))
     6 GENDER_CHOICES = (( 'M', 'Male'), ('F', 'Female'))
     8 RIGHTS_CHOICES = (
     7 RIGHTS_CHOICES = (
     9 	("AD", "Admin"),
     8 	("AD", "Admin"),
    10 	("MN", "Manager"),
     9 	("MN", "Manager"),
    11 	("DV", "Developer"),
    10 	("DV", "Developer"),
    12 	("CT", "Contributor"),)
    11 	("CT", "Contributor"),)
    13 
    12 
    14 STATUS_CHOICES = (
    13 STATUS_CHOICES = (
    15     ("UP", "Unpublished"),
    14     ("UP", "Unpublished"),
    16 	("OP", "Open"),
    15     ("OP", "Open"),
    17     ("LO", "Locked"),
    16     ("LO", "Locked"),
    18 	("CL", "Claimed"),
    17     ("CL", "Claimed"),
    19 	("AS", "Assigned"),
    18     ("AS", "Assigned"),
    20     ("RE", "Reopened"),
    19     ("RE", "Reopened"),
    21     ("CD", "Closed"),
    20     ("CD", "Closed"),
    22     ("DL", "Deleted"),
    21     ("DL", "Deleted"),
    23     ("CM", "Completed"))
    22     ("CM", "Completed"))
    24 
    23 
   106     
   105     
   107     task = models.ForeignKey('Task')
   106     task = models.ForeignKey('Task')
   108     user = models.ForeignKey(User)
   107     user = models.ForeignKey(User)
   109     message = models.TextField()
   108     message = models.TextField()
   110     creation_datetime = models.DateTimeField()
   109     creation_datetime = models.DateTimeField()
       
   110 
       
   111 class Request(models.Model):
       
   112 
       
   113     to = models.ForeignKey(User, related_name = "%(class)s_to", blank = False)
       
   114     by = models.ForeignKey(User, related_name = "%(class)s_by", blank = False)
       
   115     role = models.CharField(max_length = 2, blank = False)
       
   116     is_active = models.BooleanField(default = True)
       
   117     reply = models.BooleanField(default = False)
       
   118     read = models.BooleanField()
       
   119     creation_date = models.DateTimeField()
       
   120     reply_date = models.DateTimeField()
       
   121 
       
   122 class Notification(models.Model):
       
   123 
       
   124     to = models.ManyToManyField(User, related_name = "%(class)s_to", blank = False)
       
   125     is_read = models.BooleanField(default = False)
       
   126     sent_date = models.DateTimeField()
       
   127     sub = models.CharField(max_length = 100)
       
   128     message = models.TextField()
       
   129     deleted = models.BoolenField(default = False)
   111     
   130     
   112 tagging.register(Profile)
   131 tagging.register(Profile)
   113 tagging.register(Task)
   132 tagging.register(Task)