(view)
| 171 | |
| 172 | @staticmethod |
| 173 | def _get_view_func(view): |
| 174 | urlconf = get_urlconf() |
| 175 | if get_resolver(urlconf)._is_callback(view): |
| 176 | mod, func = get_mod_func(view) |
| 177 | try: |
| 178 | # Separate the module and function, e.g. |
| 179 | # 'mymodule.views.myview' -> 'mymodule.views', 'myview'). |
| 180 | return getattr(import_module(mod), func) |
| 181 | except ImportError: |
| 182 | # Import may fail because view contains a class name, e.g. |
| 183 | # 'mymodule.views.ViewContainer.my_view', so mod takes the form |
| 184 | # 'mymodule.views.ViewContainer'. Parse it again to separate |
| 185 | # the module and class. |
| 186 | mod, klass = get_mod_func(mod) |
| 187 | return getattr(getattr(import_module(mod), klass), func) |
| 188 | |
| 189 | def get_context_data(self, **kwargs): |
| 190 | view = self.kwargs["view"] |
no test coverage detected