<s> from csvkit import CSVKitWriter <EOL> from django . db import connection <EOL> from calaccess_campaign_browser import models <EOL> from calaccess_campaign_browser . management . commands import CalAccessCommand <EOL> class Command ( CalAccessCommand ) : <EOL> help = '<STR_LIT>' <EOL> def handle ( self , * args , ** options ) : <EOL> self . cursor = connection . cursor ( ) <EOL> sql = """<STR_LIT>""" % dict ( <EOL> candidate = models . Candidate . _meta . db_table , <EOL> office = models . Office . _meta . db_table , <EOL> filer = models . Filer . _meta . db_table , <EOL> ) <EOL> self . cursor . execute ( sql ) <EOL> writer = CSVKitWriter ( open ( "<STR_LIT>" , '<STR_LIT:wb>' ) ) <EOL> writer . writerow ( [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT:name>' , <EOL> '<STR_LIT>' <EOL> ] ) <EOL> writer . writerows ( self . cursor . fetchall ( ) ) </s>
