blob: 1966a5cf95c0b4095e11244261a8976a555e75c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2019-02-13 21:48
from __future__ import unicode_literals
import sys
from django.db import migrations
def gen_index(apps, schema_editor):
from ishtar_common.models import Document
q = Document.objects
ln = q.count()
if ln:
sys.stdout.write("\n")
for idx, doc in enumerate(Document.objects.all()):
sys.stdout.write(" * {}/{}\r".format(idx, ln))
sys.stdout.flush()
doc._no_move = True
doc.save()
if ln:
sys.stdout.write("\n")
class Migration(migrations.Migration):
dependencies = [
('ishtar_common', '0084_auto_20190206_1522'),
('archaeological_warehouse', '0033_auto_20190212_1524'),
]
operations = [
migrations.RunPython(gen_index)
]
|