def get_name_on_date(self, date):
if date is None:<EOL><INDENT>return self.name<EOL><DEDENT>post_name_changes = CompanyNameChange.objects.filter(company=self,<EOL>date__gte=date).order_by('<STR_LIT:date>')<EOL>if post_name_changes.count() == <NUM_LIT:0>:<EOL><INDENT>return self.name<EOL><DEDENT>else:<EOL><INDENT>return post_name_changes[<NUM_LIT:0>].name_before<EOL><DEDENT>
Get the name of a company on a given date. This takes into accounts and
name changes that may have occurred.