add_statuses.py
624 Bytes
#-*- coding:utf-8 -*-
from django.core.management.base import BaseCommand
from webapp.models import MeaningStatus
class Command(BaseCommand):
def handle(self, *args, **options):
add_statuses()
def add_statuses():
MeaningStatus.objects.get_or_create(key='check', name='do sprawdzenia', display_color='orange')
MeaningStatus.objects.get_or_create(key='modify', name='do zmodyfikowania', display_color='orange')
MeaningStatus.objects.get_or_create(key='delete', name='do usunięcia', display_color='red')
MeaningStatus.objects.get_or_create(key='ok', name='sprawdzone', display_color='green')