def registry(self): """Return the application registry, or a global cache.""" if webapp2.get_app().registry: return webapp2.get_app().registry else: return AppCachedProperty.GLOBAL_CACHE