def app_label_to_verbose_name_including_dynamic(label): """ Given an app's name, return its verbose name. """ try: return app_label_to_verbose_name(label) except LookupError: match = re.match(r"direct-sharing-(?P<id>\d+)", label) if match: project = DataRequestProject.objects.get(id=int(match.group("id"))) return project.name