Skip to content

Commit

Permalink
Merge pull request #218 from KerkhoffTechnologies/3503-add-auto-rank
Browse files Browse the repository at this point in the history
update related names on some models
  • Loading branch information
kti-matt authored Jun 29, 2024
2 parents 06eef8a + 1259438 commit da26ade
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 5 deletions.
2 changes: 1 addition & 1 deletion djautotask/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
VERSION = (1, 5, 9, 'final')
VERSION = (1, 6, 0, 'final')

# pragma: no cover
if VERSION[-1] != "final":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.11 on 2024-06-17 10:14

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('djautotask', '0115_task_task_type'),
]

operations = [
migrations.AlterField(
model_name='servicecall',
name='tasks',
field=models.ManyToManyField(through='djautotask.ServiceCallTask', to='djautotask.task'),
),
migrations.AlterField(
model_name='servicecall',
name='tickets',
field=models.ManyToManyField(through='djautotask.ServiceCallTicket', to='djautotask.ticket'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 4.2.11 on 2024-06-17 11:37

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('djautotask', '0116_alter_servicecall_tasks_alter_servicecall_tickets'),
]

operations = [
migrations.AlterField(
model_name='tasknote',
name='task',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='notes', to='djautotask.task'),
),
migrations.AlterField(
model_name='ticketnote',
name='ticket',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='notes', to='djautotask.ticket'),
),
]
11 changes: 7 additions & 4 deletions djautotask/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ class TicketNote(TimeStampedModel, Note):
choices=Note.PUBLISH_CHOICES
)
ticket = models.ForeignKey(
'Ticket', blank=True, null=True, on_delete=models.SET_NULL
'Ticket', blank=True, null=True, on_delete=models.SET_NULL,
related_name='notes'
)
created_by_contact = models.ForeignKey(
'Contact', blank=True, null=True, on_delete=models.SET_NULL
Expand Down Expand Up @@ -519,7 +520,11 @@ class TaskNote(TimeStampedModel, Note):
null=True,
choices=Note.PUBLISH_CHOICES)
task = models.ForeignKey(
'Task', blank=True, null=True, on_delete=models.SET_NULL
'Task',
blank=True,
null=True,
on_delete=models.SET_NULL,
related_name='notes'
)
created_by_contact = models.ForeignKey(
'Contact', blank=True, null=True, on_delete=models.SET_NULL
Expand Down Expand Up @@ -1033,11 +1038,9 @@ class ServiceCall(TimeStampedModel):

tickets = models.ManyToManyField(
'Ticket', through='ServiceCallTicket',
related_name='ticket_service_calls'
)
tasks = models.ManyToManyField(
'Task', through='ServiceCallTask',
related_name='task_service_calls'
)

AUTOTASK_FIELDS = {
Expand Down

0 comments on commit da26ade

Please sign in to comment.