Задать вопрос

Тел: +7 965 3737 888

601

Просмотров

1

Ответов

extras.py for management commands

<p>! Note - no longer needed </p>
<p>Save this script in the same directory as manage.py and run it through the command line.</p>
<p>It picks up project Command class instances. Something that will hopefully be fixed in the Django SVN version soon.</p>
<p>Heres an example of a command:</p>
<h1>utils/management/commands/sqlallall.py</h1>
<p>from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.db import models</p>
<p>class Command(BaseCommand):
    help = "Returns sqlall for all installed apps."</p>
def handle(self, *args, **options):
    """
    Returns sqlall for all installed apps.
    """

    for app in models.get_apps():
        call_command("sqlall", app.__name__.split(".")[-2])

Вопрос полезен? Да0/Нет0
file_5155.py(8.2Кб)
None

Ответы (1):

Ответdnordberg:04.04.2010
Ответ полезен? Да0/Нет0

not needed since management commands were fixed for django