Fixes.
authorRadek Czajka <rczajka@rczajka.pl>
Wed, 15 Apr 2020 15:12:13 +0000 (17:12 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Wed, 15 Apr 2020 15:12:13 +0000 (17:12 +0200)
src/catalogue/management/commands/import_catalogue_from_wl_dump.py
src/catalogue/migrations/0011_auto_20200415_1517.py [new file with mode: 0644]
src/catalogue/models.py

index 226fc47..4d69eb4 100644 (file)
@@ -15,7 +15,6 @@ class Command(BaseCommand):
             data = json.load(f)
         for item in data:
             if item['model'] == 'pdcounter.bookstub':
-                continue
                 notes = []
                 slug = item['fields']['slug']
                 book, created = Book.objects.get_or_create(slug=slug)
@@ -55,6 +54,7 @@ class Command(BaseCommand):
                     author.year_of_death = author.year_of_death or item['fields']['death']
                     author.notes = author.notes or item['fields']['description']
                     author.gazeta_link = author.gazeta_link or item['fields']['gazeta_link']
+                    author.save()
                     wiki_link = item['fields']['wiki_link']
                     assert not wiki_link # Welp
             else:
diff --git a/src/catalogue/migrations/0011_auto_20200415_1517.py b/src/catalogue/migrations/0011_auto_20200415_1517.py
new file mode 100644 (file)
index 0000000..fe5dea3
--- /dev/null
@@ -0,0 +1,18 @@
+# Generated by Django 3.0.4 on 2020-04-15 15:17
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('catalogue', '0010_auto_20200415_1336'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='book',
+            name='language',
+            field=models.CharField(blank=True, max_length=255),
+        ),
+    ]
index 530483c..250a115 100644 (file)
@@ -47,7 +47,7 @@ class Book(WikidataMixin, models.Model):
         blank=True,
     )
     title = models.CharField(max_length=255, blank=True)
-    language = models.CharField(max_length=3, blank=True)
+    language = models.CharField(max_length=255, blank=True)
     based_on = models.ForeignKey(
         "self", models.PROTECT, related_name="translation", null=True, blank=True
     )