Projet

Général

Profil

Télécharger (456 octets) Statistiques
| Branche: | Tag: | Révision:

calebasse / calebasse / personnes / management / commands / fix-group-holiday-services.py @ 0d4bf0b4

1 0d4bf0b4 Serghei MIHAI
from django.core.management.base import BaseCommand, CommandError
2
3
class Command(BaseCommand):
4
5
    def handle(self, *args, **kwargs):
6
        from calebasse.personnes.models import Holiday
7
        from calebasse.ressources.models import Service
8
9
        all_services = list(Service.objects.all())
10
11
        for holiday in Holiday.objects.filter(services__isnull=True):
12
            for service in all_services:
13
                holiday.services.add(service)