Browse Source

Změna NoArgsCommand na BaseCommand kvůli upgrade Djanga

https://docs.djangoproject.com/en/1.11/releases/1.8/

django.core.management.NoArgsCommand

The class NoArgsCommand is now deprecated and will be removed in Django
1.10. Use BaseCommand instead, which takes no arguments by default.
middleware_test
LEdoian 6 years ago
parent
commit
6d9c2ea021
  1. 4
      seminar/management/commands/auth.py
  2. 4
      seminar/management/commands/testdata.py

4
seminar/management/commands/auth.py

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.core.management.base import NoArgsCommand from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session from django.contrib.sessions.models import Session
from django.contrib.auth.models import User from django.contrib.auth.models import User
class Command(NoArgsCommand): class Command(BaseCommand):
u"""Vypiš username přihlášeného orga s daným session_key. u"""Vypiš username přihlášeného orga s daným session_key.
Příkaz pro manage.py, který ze vstupu přečte session_key (tak, jak je Příkaz pro manage.py, který ze vstupu přečte session_key (tak, jak je

4
seminar/management/commands/testdata.py

@ -4,7 +4,7 @@ import datetime
import os import os
import random import random
from django.core.management.base import NoArgsCommand from django.core.management.base import BaseCommand
from django.core.management import call_command from django.core.management import call_command
from django.conf import settings from django.conf import settings
@ -14,7 +14,7 @@ import django.contrib.auth
User = django.contrib.auth.get_user_model() User = django.contrib.auth.get_user_model()
class Command(NoArgsCommand): class Command(BaseCommand):
help = "Clear database and load testing data." help = "Clear database and load testing data."
def handle_noargs(self, **options): def handle_noargs(self, **options):

Loading…
Cancel
Save