Let's see if I understand your proposal correctly: Workflow and Step act as template and are used to define the structure of different workflows. Project and Task 'implement' the template and are used as for actual work flows. So I formulate things that are fixed using the template and for the rest I use Project and Task models.
I adapted your code a bit: For each Step one can specify an assignee and a deadline that act as suggestions for the same data of the task model. So when a task is created, it is at first filled using the information in the Step model. In addition I added some more information to the Project.
-- I adapted your code a bit: For each Step one can specify an assignee and a deadline that act as suggestions for the same data of the task model. So when a task is created, it is at first filled using the information in the Step model. In addition I added some more information to the Project.
from django.db import models
from django.contrib.auth.models import User
class Workflow(models.Model):
name = models.charfield(max_length = 200)
description = models.TextField()
class Step(models.Model):
workflow = models.ForeignKeyField(Workflow)
name = models.charfield()
order = models.SmallIntegerField()
taskdescription = models.TextField()
# suggestions for deadline / assignee
deadline = # implement as number of days from project.start_date or as number of days from start of current step. How?
assigned_to = models.ForeignKeyField(User, blank=True, null=True)
class Project(models.Model):
name = models.charfield()
workflow = models.ForeignKeyField(Workflow)
creation_date = models.DatetimeField(auto_now_add = True)
creator = models.ForeignKeyField(User)
start_date = models.DatetimeField() # in case start of project differs from creation date, default: creation date
class Task(models.Model):
project = models.ForeignKeyField(Project)
step = models.ForeignKeyField(Step)
deadline = models.DatetimeField() # initially computed from project.start_date, may be postponed by the user
assigned_to = models.ForeignKeyField(User, blank=True, null=True) # initially as given by Step, may be changed later
start = models.DatetimeField(blank=True, null=True)
finish = models.DatetimeField(blank=True, null=True)
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b940920b-31b3-42d2-99cb-0ba3cbc1d1f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment