plwiki for books
authorRadek Czajka <rczajka@rczajka.pl>
Fri, 6 Oct 2023 12:13:43 +0000 (14:13 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Fri, 6 Oct 2023 12:13:43 +0000 (14:13 +0200)
src/catalogue/admin.py
src/catalogue/migrations/0051_book_plwiki.py [new file with mode: 0644]
src/catalogue/models.py

index a035cc8..7eafe7b 100644 (file)
@@ -420,6 +420,7 @@ class BookAdmin(WikidataAdminMixin, NumericFilterModelAdmin):
                     "based_on",
                     "original_year",
                     "pd_year",
                     "based_on",
                     "original_year",
                     "pd_year",
+                    "plwiki",
                 ]
             },
         ),
                 ]
             },
         ),
diff --git a/src/catalogue/migrations/0051_book_plwiki.py b/src/catalogue/migrations/0051_book_plwiki.py
new file mode 100644 (file)
index 0000000..cc8a829
--- /dev/null
@@ -0,0 +1,18 @@
+# Generated by Django 4.1.9 on 2023-10-06 14:11
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ("catalogue", "0050_audience_woblink"),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name="book",
+            name="plwiki",
+            field=models.CharField(blank=True, max_length=255),
+        ),
+    ]
index 9768057..8db23ab 100644 (file)
@@ -279,6 +279,7 @@ class Book(WikidataModel):
     )
     original_year = models.IntegerField(_('original publication year'), null=True, blank=True)
     pd_year = models.IntegerField(_('year of entry into PD'), null=True, blank=True)
     )
     original_year = models.IntegerField(_('original publication year'), null=True, blank=True)
     pd_year = models.IntegerField(_('year of entry into PD'), null=True, blank=True)
+    plwiki = models.CharField(blank=True, max_length=255)
     gazeta_link = models.CharField(_("gazeta link"), max_length=255, blank=True)
     collections = models.ManyToManyField("Collection", blank=True, verbose_name=_("collections"))
 
     gazeta_link = models.CharField(_("gazeta link"), max_length=255, blank=True)
     collections = models.ManyToManyField("Collection", blank=True, verbose_name=_("collections"))
 
@@ -298,6 +299,7 @@ class Book(WikidataModel):
         verbose_name_plural = _('books')
 
     class Wikidata:
         verbose_name_plural = _('books')
 
     class Wikidata:
+        plwiki = "plwiki"
         authors = WIKIDATA.AUTHOR
         translators = WIKIDATA.TRANSLATOR
         title = WIKIDATA.TITLE
         authors = WIKIDATA.AUTHOR
         translators = WIKIDATA.TRANSLATOR
         title = WIKIDATA.TITLE