<commit_before>#-*- coding: utf-8 -*-

from django.core.management.base import BaseCommand, CommandError

from django.template.loader import get_template
from django.template import Context

from base.models import *
from subscribe.models import *

from xhtml2pdf import pisa
import cStringIO as StringIO
import cgi
import sys

class Command(BaseCommand):
    args = ''
    help = 'print info PDF for all events'

    def handle(self, *args, **options):
        events = EventHappening.objects.select_related('event').all()
        n_events = events.count()

        done = 0

        for eh in events:

            con = {}
            con['nome'] = eh.event.name
            con['descrizione'] = eh.event.description
            con['turno'] = eh.timeslot.name
            con['print_code'] = eh.event.print_code
            con['spalle'] = []

            for spalla in eh.scoutchiefsubscription_set.filter(scout_chief__is_spalla=True):
                con['spalle'].append({<commit_msg>La stampa pdf esclude gli eventi disabilitati<commit_after>#-*- coding: utf-8 -*-

from django.core.management.base import BaseCommand, CommandError

from django.template.loader import get_template
from django.template import Context

from base.models import *
from subscribe.models import *

from xhtml2pdf import pisa
import cStringIO as StringIO
import cgi
import sys

class Command(BaseCommand):
    args = ''
    help = 'print info PDF for all events'

    def handle(self, *args, **options):
        events = EventHappening.objects.select_related('event').exclude(event__state_activation='DISMISSED')
        n_events = events.count()

        done = 0

        for eh in events:

            con = {}
            con['nome'] = eh.event.name
            con['descrizione'] = eh.event.description
            con['turno'] = eh.timeslot.name
            con['print_code'] = eh.event.print_code
            con['spalle'] = []

            for spalla in eh.scoutchiefsubscription_set.filter(scout_chief__is_spalla=True):
                con['spalle'].append({
{'fraction_non_alphanumeric': 0.10580204778156997, 'fraction_numerical': 0.0029254022428083864, 'mean_word_length': 2.737704918032787, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1780639', 'n_tokens_mistral': 618, 'n_tokens_neox': 584, 'n_words': 151}