@pjax()<EOL>def committees(request, abbr):
try:<EOL><INDENT>meta = Metadata.get_object(abbr)<EOL><DEDENT>except DoesNotExist:<EOL><INDENT>raise Http404<EOL><DEDENT>chamber = request.GET.get('<STR_LIT>', '<STR_LIT>')<EOL>if chamber in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>chamber_name = meta['<STR_LIT>'][chamber]['<STR_LIT:name>']<EOL>spec = {'<STR_LIT>': chamber}<EOL>show_chamber_column = False<EOL><DEDENT>elif chamber == '<STR_LIT>':<EOL><INDENT>chamber_name = '<STR_LIT>'<EOL>spec = {'<STR_LIT>': '<STR_LIT>'}<EOL>show_chamber_column = False<EOL><DEDENT>else:<EOL><INDENT>chamber = '<STR_LIT>'<EOL>spec = {}<EOL>show_chamber_column = True<EOL>chamber_name = '<STR_LIT>'<EOL><DEDENT>chambers = dict((k, v['<STR_LIT:name>']) for k, v in meta['<STR_LIT>'].items())<EOL>if meta.committees({'<STR_LIT>': '<STR_LIT>'}).count():<EOL><INDENT>chambers['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT>fields = mongo_fields('<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>settings.LEVEL_FIELD, '<STR_LIT>')<EOL>sort_key = request.GET.get('<STR_LIT:key>', '<STR_LIT>')<EOL>sort_order = int(request.GET.get('<STR_LIT>', <NUM_LIT:1>))<EOL>committees = meta.committees_legislators(spec, fields=fields,<EOL>sort=[(sort_key, sort_order)])<EOL>sort_order = -sort_order<EOL>return TemplateResponse(<EOL>request, templatename('<STR_LIT>'),<EOL>dict(chamber=chamber, committees=committees, abbr=abbr, metadata=meta,<EOL>chamber_name=chamber_name,<EOL>chamber_select_template=templatename('<STR_LIT>'),<EOL>chamber_select_collection='<STR_LIT>',<EOL>chamber_select_chambers=chambers,<EOL>committees_table_template=templatename('<STR_LIT>'),<EOL>show_chamber_column=show_chamber_column, sort_order=sort_order,<EOL>nav_active='<STR_LIT>'))<EOL>
Context:
    chamber
    committees
    abbr
    metadata
    chamber_name
    chamber_select_template
    chamber_select_collection
    chamber_select_chambers
    committees_table_template
    show_chamber_column
    sort_order
    nav_active

Templates:
    - billy/web/public/committees.html
    - billy/web/public/committees-pjax.html
    - billy/web/public/chamber_select_form.html
    - billy/web/public/committees_table.html