def get_context_data(self, *args, **kwargs):
context = super(RelatedBillsList, self).get_context_data(*args,<EOL>**kwargs)<EOL>metadata = context['<STR_LIT>']<EOL>FilterBillsForm = get_filter_bills_form(metadata)<EOL>if self.request.GET:<EOL><INDENT>form = FilterBillsForm(self.request.GET)<EOL>search_text = form.data.get('<STR_LIT>')<EOL>context.update(search_text=search_text)<EOL>context.update(form=FilterBillsForm(self.request.GET))<EOL>description = []<EOL>if metadata:<EOL><INDENT>description.append(metadata['<STR_LIT:name>'])<EOL><DEDENT>else:<EOL><INDENT>description = ['<STR_LIT>']<EOL><DEDENT>long_description = []<EOL>chamber = form.data.get('<STR_LIT>')<EOL>session = form.data.get('<STR_LIT>')<EOL>type = form.data.get('<STR_LIT:type>')<EOL>status = form.data.getlist('<STR_LIT:status>')<EOL>subjects = form.data.getlist('<STR_LIT>')<EOL>sponsor = form.data.get('<STR_LIT>')<EOL>if chamber:<EOL><INDENT>if metadata:<EOL><INDENT>description.append(metadata['<STR_LIT>'][chamber]['<STR_LIT:name>']<EOL>)<EOL><DEDENT>else:<EOL><INDENT>description.extend([chamber.title(), '<STR_LIT>'])<EOL><DEDENT><DEDENT>description.append((type or '<STR_LIT>') + '<STR_LIT:s>')<EOL>if session:<EOL><INDENT>description.append(<EOL>'<STR_LIT>' %<EOL>metadata['<STR_LIT>'][session]['<STR_LIT>']<EOL>)<EOL><DEDENT>if '<STR_LIT>' in status:<EOL><INDENT>long_description.append('<STR_LIT>')<EOL><DEDENT>elif '<STR_LIT>' in status and '<STR_LIT>' in status:<EOL><INDENT>long_description.append('<STR_LIT>')<EOL><DEDENT>elif '<STR_LIT>' in status:<EOL><INDENT>chamber_name = (metadata['<STR_LIT>']['<STR_LIT>']['<STR_LIT:name>']<EOL>if metadata else '<STR_LIT>')<EOL>long_description.append('<STR_LIT>' +<EOL>chamber_name)<EOL><DEDENT>elif '<STR_LIT>' in status:<EOL><INDENT>chamber_name = (metadata['<STR_LIT>']['<STR_LIT>']['<STR_LIT:name>']<EOL>if metadata else '<STR_LIT>')<EOL>long_description.append('<STR_LIT>' +<EOL>chamber_name)<EOL><DEDENT>if sponsor:<EOL><INDENT>leg = db.legislators.find_one({'<STR_LIT>': sponsor},<EOL>fields=('<STR_LIT>', '<STR_LIT>'))<EOL>leg = leg['<STR_LIT>']<EOL>long_description.append('<STR_LIT>' + leg)<EOL><DEDENT>if subjects:<EOL><INDENT>long_description.append('<STR_LIT>' + '<STR_LIT:U+002CU+0020>'.join(subjects))<EOL><DEDENT>if search_text:<EOL><INDENT>long_description.append(u'<STR_LIT>'.format(<EOL>search_text))<EOL><DEDENT>context.update(long_description=long_description)<EOL><DEDENT>else:<EOL><INDENT>if metadata:<EOL><INDENT>description = [metadata['<STR_LIT:name>'], '<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>description = ['<STR_LIT>']<EOL><DEDENT>context.update(form=FilterBillsForm())<EOL><DEDENT>context.update(description='<STR_LIT:U+0020>'.join(description))<EOL>params = list(self.request.GET.lists())<EOL>for k, v in params[:]:<EOL><INDENT>if k == '<STR_LIT>':<EOL><INDENT>params.remove((k, v))<EOL><DEDENT><DEDENT>get_params = urllib.urlencode(params, doseq=True)<EOL>context['<STR_LIT>'] = get_params<EOL>context['<STR_LIT>'] = self.kwargs['<STR_LIT>']<EOL>return context<EOL>
Context:
    If GET parameters are given:
    - search_text
    - form (FilterBillsForm)
    - long_description
    - description
    - get_params
    Otherwise, the only context item is an unbound FilterBillsForm.

Templates:
    - Are specified in subclasses.