This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: assign users to customers, projects and tasks
update serializers create new through-tables for assigned users update django-admin for user assignement
- Loading branch information
Showing
6 changed files
with
170 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Generated by Django 3.1.7 on 2021-04-19 12:59 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('projects', '0010_project_billed'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='TaskAssignee', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('is_resource', models.BooleanField(default=False)), | ||
('is_reviewer', models.BooleanField(default=False)), | ||
('is_manager', models.BooleanField(default=False)), | ||
('task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_assignees', to='projects.task')), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_assignees', to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='ProjectAssignee', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('is_resource', models.BooleanField(default=False)), | ||
('is_reviewer', models.BooleanField(default=False)), | ||
('is_manager', models.BooleanField(default=False)), | ||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_assignees', to='projects.project')), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_assignees', to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='CustomerAssignee', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('is_resource', models.BooleanField(default=False)), | ||
('is_reviewer', models.BooleanField(default=False)), | ||
('is_manager', models.BooleanField(default=False)), | ||
('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='customer_assignees', to='projects.customer')), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='customer_assignees', to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name='customer', | ||
name='assignees', | ||
field=models.ManyToManyField(related_name='assigned_to_customers', through='projects.CustomerAssignee', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='project', | ||
name='assignees', | ||
field=models.ManyToManyField(related_name='assigned_to_projects', through='projects.ProjectAssignee', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='task', | ||
name='assignees', | ||
field=models.ManyToManyField(related_name='assigned_to_tasks', through='projects.TaskAssignee', to=settings.AUTH_USER_MODEL), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters