mirror of
https://github.com/Hopiu/django-watson.git
synced 2026-05-16 09:03:09 +00:00
List all registred models (management command)
Exposed the ``watson.get_registered_models()`` function as management command for debugging purpose.
This commit is contained in:
parent
de5fcb3064
commit
91d3f2040e
1 changed files with 16 additions and 0 deletions
|
|
@ -0,0 +1,16 @@
|
|||
"""Exposed the watson.get_registered_models() function as management command for debugging purpose. """
|
||||
|
||||
from django.core.management.base import NoArgsCommand
|
||||
import watson
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
|
||||
help = "List all registed models by django-watson."
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
"""Runs the management command."""
|
||||
self.stdout.write("The following models are registed for the django-watson seach engine:\n")
|
||||
for mdl in watson.get_registered_models():
|
||||
self.stdout.write("- %s\n" % mdl.__name__)
|
||||
|
||||
|
||||
Loading…
Reference in a new issue