from django.core.management.base import BaseCommand, CommandError

from app.models import Person, MainDocuments, Person2Document
import re

class Command(BaseCommand):

    def handle(self, *args, **options):
        print('Search optimization.')   
        #Person.objects.all().delete()
        for md in MainDocuments.objects.all().order_by('-id'):
            md.search_opt()
            print("document  %s" % md.id)

        for md in Person.objects.all().order_by('-id'):
            md.search_opt()
            print("persom  %s" % md.id)
213e9a985d5d3214d3c66ce43f199212fbf57b26
<mask token>

<mask token>


class Command(BaseCommand):
    <mask token>

<mask token>


class Command(BaseCommand):

    def handle(self, *args, **options):
        print('Search optimization.')
        for md in MainDocuments.objects.all().order_by('-id'):
            md.search_opt()
            print('document  %s' % md.id)
        for md in Person.objects.all().order_by('-id'):
            md.search_opt()
            print('persom  %s' % md.id)

from django.core.management.base import BaseCommand, CommandError
from app.models import Person, MainDocuments, Person2Document
import re


class Command(BaseCommand):

    def handle(self, *args, **options):
        print('Search optimization.')
        for md in MainDocuments.objects.all().order_by('-id'):
            md.search_opt()
            print('document  %s' % md.id)
        for md in Person.objects.all().order_by('-id'):
            md.search_opt()
            print('persom  %s' % md.id)

from django.core.management.base import BaseCommand, CommandError

from app.models import Person, MainDocuments, Person2Document
import re

class Command(BaseCommand):

    def handle(self, *args, **options):
        print('Search optimization.')   
        #Person.objects.all().delete()
        for md in MainDocuments.objects.all().order_by('-id'):
            md.search_opt()
            print("document  %s" % md.id)

        for md in Person.objects.all().order_by('-id'):
            md.search_opt()
            print("persom  %s" % md.id)