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)
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:
--- /dev/null
+# 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),
+ ),
+ ]
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
)