From 7b1693a4359c605713f7c0c33968fc508d151b6f Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 17 Jan 2022 09:03:53 -0800 Subject: [PATCH] Larger file type field --- .../migrations/0129_auto_20220117_1703.py | 24 +++++++++++++++++++ bookwyrm/models/link.py | 3 ++- bookwyrm/static/js/autocomplete.js | 17 +++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 bookwyrm/migrations/0129_auto_20220117_1703.py diff --git a/bookwyrm/migrations/0129_auto_20220117_1703.py b/bookwyrm/migrations/0129_auto_20220117_1703.py new file mode 100644 index 00000000..f193ca95 --- /dev/null +++ b/bookwyrm/migrations/0129_auto_20220117_1703.py @@ -0,0 +1,24 @@ +# Generated by Django 3.2.10 on 2022-01-17 17:03 + +import bookwyrm.models.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('bookwyrm', '0128_merge_0126_auto_20220112_2315_0127_auto_20220110_2211'), + ] + + operations = [ + migrations.AddField( + model_name='filelink', + name='is_purchase', + field=bookwyrm.models.fields.BooleanField(blank=True, null=True), + ), + migrations.AlterField( + model_name='filelink', + name='filetype', + field=bookwyrm.models.fields.CharField(max_length=50), + ), + ] diff --git a/bookwyrm/models/link.py b/bookwyrm/models/link.py index be7c104f..c4ec1e5e 100644 --- a/bookwyrm/models/link.py +++ b/bookwyrm/models/link.py @@ -53,7 +53,8 @@ class FileLink(Link): book = models.ForeignKey( "Book", on_delete=models.CASCADE, related_name="file_links", null=True ) - filetype = fields.CharField(max_length=5, activitypub_field="mediaType") + filetype = fields.CharField(max_length=50, activitypub_field="mediaType") + is_purchase = fields.BooleanField(null=True, blank=True) StatusChoices = [ diff --git a/bookwyrm/static/js/autocomplete.js b/bookwyrm/static/js/autocomplete.js index 89610083..1ae8c71a 100644 --- a/bookwyrm/static/js/autocomplete.js +++ b/bookwyrm/static/js/autocomplete.js @@ -160,6 +160,23 @@ const tries = { }, }, }, + r: { + i: { + n: { + t: { + " ": { + b: { + o: { + o: { + k: "Print book", + }, + }, + }, + }, + }, + }, + }, + }, }, }, };