From a9b1344a5990b4190fad638eededae0c83d0115e Mon Sep 17 00:00:00 2001 From: Sam Wolfe Date: Tue, 10 Dec 2024 13:25:27 -0800 Subject: [PATCH] remove recent related_names --- djautotask/__init__.py | 2 +- ...ect_account_alter_task_project_and_more.py | 29 +++++++++++++++++++ djautotask/models.py | 8 ++--- 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 djautotask/migrations/0125_alter_project_account_alter_task_project_and_more.py diff --git a/djautotask/__init__.py b/djautotask/__init__.py index 38ba9b3..b590349 100644 --- a/djautotask/__init__.py +++ b/djautotask/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -VERSION = (1, 6, 13, 'final') +VERSION = (1, 6, 14, 'final') # pragma: no cover if VERSION[-1] != "final": diff --git a/djautotask/migrations/0125_alter_project_account_alter_task_project_and_more.py b/djautotask/migrations/0125_alter_project_account_alter_task_project_and_more.py new file mode 100644 index 0000000..ab6e8da --- /dev/null +++ b/djautotask/migrations/0125_alter_project_account_alter_task_project_and_more.py @@ -0,0 +1,29 @@ +# Generated by Django 4.2.16 on 2024-12-10 11:53 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('djautotask', '0124_project_create_date_time'), + ] + + operations = [ + migrations.AlterField( + model_name='project', + name='account', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='djautotask.account'), + ), + migrations.AlterField( + model_name='task', + name='project', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='djautotask.project'), + ), + migrations.AlterField( + model_name='ticket', + name='account', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='djautotask.account'), + ), + ] diff --git a/djautotask/models.py b/djautotask/models.py index 25fa8e1..e409734 100644 --- a/djautotask/models.py +++ b/djautotask/models.py @@ -74,8 +74,7 @@ class Ticket(TimeStampedModel): 'Contact', blank=True, null=True, on_delete=models.SET_NULL ) account = models.ForeignKey( - 'Account', blank=True, null=True, on_delete=models.SET_NULL, - related_name='account_tickets' + 'Account', blank=True, null=True, on_delete=models.SET_NULL ) account_physical_location = models.ForeignKey( 'AccountPhysicalLocation', blank=True, null=True, @@ -621,8 +620,7 @@ class Project(TimeStampedModel): 'Contact', blank=True, null=True, on_delete=models.SET_NULL ) account = models.ForeignKey( - 'Account', null=True, on_delete=models.SET_NULL, - related_name='account_projects' + 'Account', null=True, on_delete=models.SET_NULL ) status = models.ForeignKey( 'ProjectStatus', null=True, on_delete=models.SET_NULL @@ -711,7 +709,7 @@ class Task(TimeStampedModel): related_name='secondary_resource_tasks' ) project = models.ForeignKey( - 'Project', on_delete=models.CASCADE, related_name='project_tasks' + 'Project', on_delete=models.CASCADE ) priority = models.ForeignKey( 'Priority', null=True, blank=True, on_delete=models.SET_NULL