Return a QuerySet or a Manager. Duck typing in action: any class with a `get()` method (for get_object_or_404) or a `filter()` method (for get_list_or_404) might do the job.
(klass)
| 64 | |
| 65 | |
| 66 | def _get_queryset(klass): |
| 67 | """ |
| 68 | Return a QuerySet or a Manager. |
| 69 | Duck typing in action: any class with a `get()` method (for |
| 70 | get_object_or_404) or a `filter()` method (for get_list_or_404) might do |
| 71 | the job. |
| 72 | """ |
| 73 | # If it is a model class or anything else with ._default_manager |
| 74 | if hasattr(klass, "_default_manager"): |
| 75 | return klass._default_manager.all() |
| 76 | return klass |
| 77 | |
| 78 | |
| 79 | def get_object_or_404(klass, *args, **kwargs): |
no test coverage detected