Skip to content

Commit

Permalink
Add per-capita value to DUI query
Browse files Browse the repository at this point in the history
  • Loading branch information
ghing committed Dec 20, 2014
1 parent a2cbe77 commit badd94f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Command(BaseCommand):
make_option('--count',
action='store',
type='int',
default=20,
default=77,
dest='count',
help="Show this many statutes"),
make_option('--model',
Expand All @@ -25,7 +25,7 @@ def handle(self, *args, **options):
model_cls = getattr(convictions_data.models, options['model'])
qs = model_cls.objects.all().with_dui_annotations().order_by('-num_dui')

fieldnames = ['name', 'count', 'pct']
fieldnames = ['name', 'count', 'pct', 'per_capita']
writer = csv.DictWriter(self.stdout,
fieldnames=fieldnames)

Expand All @@ -36,5 +36,6 @@ def handle(self, *args, **options):
'name': geo.name,
'count': geo.num_dui,
'pct': geo.pct_dui,
'per_capita': geo.dui_per_capita,
}
writer.writerow(row)

0 comments on commit badd94f

Please sign in to comment.