Skip to content

Commit

Permalink
new RelatedLink format choices, update helptext
Browse files Browse the repository at this point in the history
ref #958
  • Loading branch information
blms committed Dec 5, 2023
1 parent 6d03b12 commit cd1550e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
6 changes: 4 additions & 2 deletions apps/iiif/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ class Choices():

""" List of Mime type choices. """
MIMETYPES = (
('text/html', 'HTML'),
('text/html', 'HTML or web page'),
('application/json', 'JSON'),
('application/ld+json', 'JSON-LD'),
('application/pdf', 'PDF'),
('text/plain', 'Text'),
('application/xml', 'XML'),
('text/plan', 'Text'),
('application/octet-stream', 'Other'),
)

"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 3.2.12 on 2023-12-05 16:16

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("manifests", "0057_alter_manifest_languages"),
]

operations = [
migrations.AlterField(
model_name="relatedlink",
name="data_type",
field=models.CharField(
default="Dataset",
help_text="Leave as 'Dataset' for structured data describing this document (e.g. a remote manifest) and this link will appear in 'seeAlso'; change to any other value and it will only appear in the 'related' property of the manifest.",
max_length=255,
),
),
migrations.AlterField(
model_name="relatedlink",
name="format",
field=models.CharField(
blank=True,
choices=[
("text/html", "HTML or web page"),
("application/json", "JSON"),
("application/ld+json", "JSON-LD"),
("application/pdf", "PDF"),
("text/plain", "Text"),
("application/xml", "XML"),
("application/octet-stream", "Other"),
],
max_length=255,
null=True,
),
),
]
8 changes: 7 additions & 1 deletion apps/iiif/manifests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,13 @@ class RelatedLink(models.Model):
""" Links to related resources """
id = models.UUIDField(primary_key=True, default=uuid4)
link = models.CharField(max_length=255)
data_type = models.CharField(max_length=255, default='Dataset')
data_type = models.CharField(
max_length=255,
default='Dataset',
help_text="Leave as 'Dataset' for structured data describing this document (e.g. a " +
"remote manifest) and this link will appear in 'seeAlso'; change to any other value and " +
"it will only appear in the 'related' property of the manifest.",
)
label = GenericRelation(ValueByLanguage)
format = models.CharField(max_length=255, choices=Choices.MIMETYPES, blank=True, null=True)
profile = models.CharField(max_length=255, blank=True, null=True)
Expand Down

0 comments on commit cd1550e

Please sign in to comment.