Skip to content

Commit

Permalink
feat: rename fields in model: ProjectProgramAreaXref
Browse files Browse the repository at this point in the history
  • Loading branch information
del9ra committed Nov 12, 2024
1 parent 0be6331 commit b817a69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 4.2.11 on 2024-10-31 22:55
# Generated by Django 4.2.11 on 2024-11-12 20:15

from django.db import migrations, models
import django.db.models.deletion
Expand All @@ -7,7 +7,9 @@

class Migration(migrations.Migration):

dependencies = [("core", "0028_alter_userpermission_project")]
dependencies = [
("core", "0028_alter_userpermission_project"),
]

operations = [
migrations.CreateModel(
Expand All @@ -32,14 +34,14 @@ class Migration(migrations.Migration):
models.DateTimeField(auto_now=True, verbose_name="Updated at"),
),
(
"program_area_id",
"program_area",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="core.programarea",
),
),
(
"project_id",
"project",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="core.project"
),
Expand Down
4 changes: 2 additions & 2 deletions app/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,5 @@ def __str__(self):


class ProjectProgramAreaXref(AbstractBaseModel):
project_id = models.ForeignKey(Project, on_delete=models.CASCADE)
program_area_id = models.ForeignKey(ProgramArea, on_delete=models.CASCADE)
project = models.ForeignKey(Project, on_delete=models.CASCADE)
program_area = models.ForeignKey(ProgramArea, on_delete=models.CASCADE)
2 changes: 1 addition & 1 deletion app/core/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_project_program_area_relationship(project):
assert project.program_areas.contains(workforce_development_program_area)
assert workforce_development_program_area.projects.contains(project)
workforce_development_program_area_xref = ProjectProgramAreaXref.objects.get(
project_id=project, program_area_id=workforce_development_program_area
project=project, program_area=workforce_development_program_area
)
assert workforce_development_program_area_xref.created_at is not None
project.program_areas.remove(workforce_development_program_area)
Expand Down

0 comments on commit b817a69

Please sign in to comment.