11 | | # The str() is needed around opts.verbose_name because it's a |
12 | | # django.utils.functional.__proxy__ object. |
13 | | ct, created = self.model._default_manager.get_or_create(app_label=opts.app_label, |
14 | | model=opts.object_name.lower(), defaults={'name': str(opts.verbose_name)}) |
| 12 | key = (opts.app_label, opts.object_name.lower()) |
| 13 | try: |
| 14 | ct = CONTENT_TYPE_CACHE[key] |
| 15 | except KeyError: |
| 16 | # The str() is needed around opts.verbose_name because it's a |
| 17 | # django.utils.functional.__proxy__ object. |
| 18 | ct, created = self.model._default_manager.get_or_create(app_label=key[0], |
| 19 | model=key[1], defaults={'name': str(opts.verbose_name)}) |
| 20 | CONTENT_TYPE_CACHE[key] = ct |