-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spike: [nomerge] spike on restricted run modeling
- Loading branch information
1 parent
4db5daa
commit 6d14e72
Showing
3 changed files
with
197 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Generated by Django 4.2.15 on 2024-09-26 14:33 | ||
|
||
import collections | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import jsonfield.encoder | ||
import jsonfield.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('catalog', '0039_alter_catalogquery_unique_together_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Book', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=255, unique=True)), | ||
('data', jsonfield.fields.JSONField(blank=True, default={}, dump_kwargs={'cls': jsonfield.encoder.JSONEncoder, 'indent': 4, 'separators': (',', ':')}, load_kwargs={'object_pairs_hook': collections.OrderedDict}, null=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='BookSpecialCopies', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('book', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='special_copies', to='catalog.book')), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Library', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=255, unique=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='RestrictedBook', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=255, unique=True)), | ||
('data', jsonfield.fields.JSONField(blank=True, default={}, dump_kwargs={'cls': jsonfield.encoder.JSONEncoder, 'indent': 4, 'separators': (',', ':')}, load_kwargs={'object_pairs_hook': collections.OrderedDict}, null=True)), | ||
('libraries', models.ManyToManyField(to='catalog.library')), | ||
('library', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='special_copies', to='catalog.library')), | ||
('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='catalog.bookspecialcopies')), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name='book', | ||
name='libraries', | ||
field=models.ManyToManyField(to='catalog.library'), | ||
), | ||
] |
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