Update to new librarian api for html, txt.
[wolnelektury.git] / src / references / migrations / 0004_update_anchor.py
1 # Generated by Django 4.0.8 on 2024-09-18 11:29
2
3 from django.db import migrations, models
4 from django.db.models.functions import Concat
5
6
7 def update_anchor(apps, schema_editor):
8     Occurence = apps.get_model('references', 'Occurence')
9     Occurence.objects.filter(anchor='').update(
10         anchor=Concat(models.Value('sec'), 'section')
11     )
12
13
14 class Migration(migrations.Migration):
15
16     dependencies = [
17         ('references', '0003_occurence_anchor'),
18     ]
19
20     operations = [
21         migrations.RunPython(update_anchor, migrations.RunPython.noop)
22     ]