diff --git a/bookwyrm/activitypub/book.py b/bookwyrm/activitypub/book.py index 2238e3a87..7401a1346 100644 --- a/bookwyrm/activitypub/book.py +++ b/bookwyrm/activitypub/book.py @@ -16,6 +16,7 @@ class BookData(ActivityObject): librarythingKey: str = None goodreadsKey: str = None bnfId: str = None + viaf: str = None lastEditedBy: str = None links: List[str] = field(default_factory=lambda: []) fileLinks: List[str] = field(default_factory=lambda: []) diff --git a/bookwyrm/migrations/0132_auto_20220130_1938.py b/bookwyrm/migrations/0132_auto_20220130_1938.py new file mode 100644 index 000000000..a83ac2909 --- /dev/null +++ b/bookwyrm/migrations/0132_auto_20220130_1938.py @@ -0,0 +1,42 @@ +# Generated by Django 3.2.10 on 2022-01-30 19:38 + +import bookwyrm.models.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("bookwyrm", "0131_merge_20220125_1644"), + ] + + operations = [ + migrations.AddField( + model_name="author", + name="viaf", + field=bookwyrm.models.fields.CharField( + blank=True, max_length=255, null=True + ), + ), + migrations.AddField( + model_name="author", + name="wikidata", + field=bookwyrm.models.fields.CharField( + blank=True, max_length=255, null=True + ), + ), + migrations.AddField( + model_name="book", + name="viaf", + field=bookwyrm.models.fields.CharField( + blank=True, max_length=255, null=True + ), + ), + migrations.AddField( + model_name="book", + name="wikidata", + field=bookwyrm.models.fields.CharField( + blank=True, max_length=255, null=True + ), + ), + ] diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py index ffc03d3e6..c796b7d24 100644 --- a/bookwyrm/models/book.py +++ b/bookwyrm/models/book.py @@ -46,6 +46,12 @@ class BookDataModel(ObjectMixin, BookWyrmModel): bnf_id = fields.CharField( # Bibliothèque nationale de France max_length=255, blank=True, null=True, deduplication_field=True ) + viaf = fields.CharField( + max_length=255, blank=True, null=True, deduplication_field=True + ) + wikidata = fields.CharField( + max_length=255, blank=True, null=True, deduplication_field=True + ) search_vector = SearchVectorField(null=True) last_edited_by = fields.ForeignKey(