-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Authors - Updates `AuthorsOrderable` to disallow duplicate authors - Using THIS ONE `unique_together` TRICK!!! - Updates model to require `author` field of Orderable Closes #194
- Loading branch information
Showing
3 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
authors/migrations/0003_alter_authorsorderable_options_and_more.py
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,22 @@ | ||
# Generated by Django 5.0.8 on 2024-08-28 18:39 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("authors", "0002_authorsorderable"), | ||
("exhibits", "0013_alter_exhibitpage_body"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="authorsorderable", | ||
options={}, | ||
), | ||
migrations.AlterUniqueTogether( | ||
name="authorsorderable", | ||
unique_together={("page", "author")}, | ||
), | ||
] |
32 changes: 32 additions & 0 deletions
32
authors/migrations/0004_alter_authorsorderable_author_and_more.py
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,32 @@ | ||
# Generated by Django 5.0.8 on 2024-08-29 18:48 | ||
|
||
import django.db.models.deletion | ||
import modelcluster.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("authors", "0003_alter_authorsorderable_options_and_more"), | ||
("exhibits", "0013_alter_exhibitpage_body"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="authorsorderable", | ||
name="author", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="authors.author" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="authorsorderable", | ||
name="page", | ||
field=modelcluster.fields.ParentalKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="authors", | ||
to="exhibits.exhibitpage", | ||
), | ||
), | ||
] |
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