Skip to content

Commit

Permalink
Merge pull request #21 from chnm/refactor/api-data
Browse files Browse the repository at this point in the history
refactor: Update model to reflect API data
  • Loading branch information
hepplerj authored Oct 8, 2024
2 parents 47f8a3a + 4acdbed commit 55b8a5c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
22 changes: 22 additions & 0 deletions material/migrations/0004_archive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 5.0.6 on 2024-10-08 13:45

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("material", "0003_textilerecord_creator_alter_textilerecord_is_public"),
]

operations = [
migrations.CreateModel(
name="Archive",
fields=[
("id", models.AutoField(primary_key=True, serialize=False)),
("name", models.CharField(max_length=765, unique=True)),
],
options={
"verbose_name_plural": "Archives",
},
),
]
20 changes: 20 additions & 0 deletions material/migrations/0005_delete_archive_textilerecord_archive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 5.0.6 on 2024-10-08 15:16

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("material", "0004_archive"),
]

operations = [
migrations.DeleteModel(
name="Archive",
),
migrations.AddField(
model_name="textilerecord",
name="archive",
field=models.CharField(blank=True, max_length=765, null=True),
),
]
1 change: 1 addition & 0 deletions material/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class TextileRecord(models.Model):
help_text="Check this box if the record is publicly viewable. Unchecked will keep the record hidden.",
)
year = models.IntegerField(blank=True, null=True)
archive = models.CharField(max_length=765, blank=True, null=True)
primary_textile_types = models.ManyToManyField(
"PrimaryTextileType", related_name="textile_records", blank=True, default=[]
)
Expand Down

0 comments on commit 55b8a5c

Please sign in to comment.