From: Radek Czajka Date: Wed, 15 Apr 2020 15:12:13 +0000 (+0200) Subject: Fixes. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/bbf66a1eb672e6029f7d58780d3689005215d03c Fixes. --- diff --git a/src/catalogue/management/commands/import_catalogue_from_wl_dump.py b/src/catalogue/management/commands/import_catalogue_from_wl_dump.py index 226fc476..4d69eb4d 100644 --- a/src/catalogue/management/commands/import_catalogue_from_wl_dump.py +++ b/src/catalogue/management/commands/import_catalogue_from_wl_dump.py @@ -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 index 00000000..fe5dea3a --- /dev/null +++ b/src/catalogue/migrations/0011_auto_20200415_1517.py @@ -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), + ), + ] diff --git a/src/catalogue/models.py b/src/catalogue/models.py index 530483c8..250a115e 100644 --- a/src/catalogue/models.py +++ b/src/catalogue/models.py @@ -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 )