Skip to content

Rebuild index quietly from doctypeΒ #84

Open
@ahivert

Description

@ahivert

I want to test that some data are correctly created/updated in index.
Before each test I need to rebuild the index calling command search_index --rebuild --models app.django_models -f

It would be great if DocType had a classmethod to rebuild its index like this:

@classmethod
def rebuild(self):
    call_command('search_index', '--rebuild', '--models', 'app.django_model', '-f')

The management command should accept another argument like --quiet to not print anything during test

The final function could be:

@classmethod
def rebuild(self):
    call_command('search_index', '--rebuild', '--models', 'app.django_model', '-f', '--quiet')

What do you think (Can do the PR if you want) ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions