<s> import sys <EOL> import csv <EOL> from django . core . management . base import BaseCommand , CommandError <EOL> from workshops . models import Event <EOL> class Command ( BaseCommand ) : <EOL> args = '<STR_LIT>' <EOL> help = '<STR_LIT>' <EOL> def handle ( self , * args , ** options ) : <EOL> if len ( args ) != <NUM_LIT:0> : <EOL> raise CommandError ( '<STR_LIT>' ) <EOL> events = Event . objects . filter ( admin_fee__gt = <NUM_LIT:0> ) . filter ( start__isnull = False ) . order_by ( '<STR_LIT>' ) <EOL> records = [ [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ] <EOL> for e in events : <EOL> records . append ( [ e . slug , e . admin_fee , e . invoice_status ] ) <EOL> writer = csv . writer ( sys . stdout ) <EOL> writer . writerows ( records ) </s>
