File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -190,12 +190,12 @@ class ListView(TemplateView):
190
190
context_object_name = "objects"
191
191
192
192
def get (self ) -> HttpResponse :
193
- self .objects = self .get_queryset ()
193
+ self .objects = self .get_objects ()
194
194
return super ().get ()
195
195
196
- def get_queryset (self ): # Intentionally untyped... subclasses must override this.
196
+ def get_objects (self ):
197
197
raise NotImplementedError (
198
- f"get_queryset () is not implemented on { self .__class__ .__name__ } "
198
+ f"get_objects () is not implemented on { self .__class__ .__name__ } "
199
199
)
200
200
201
201
def get_context (self ) -> dict :
@@ -222,8 +222,8 @@ def get_template_names(self) -> list[str]:
222
222
223
223
# The least-specific option is the default <app>/<model>_detail.html;
224
224
# only use this if the object in question is a model.
225
- if hasattr (self .objects , "_meta" ):
226
- object_meta = self .objects ._meta
225
+ if hasattr (self .objects , "model" ) and hasattr ( self . objects . model , " _meta" ):
226
+ object_meta = self .objects .model . _meta
227
227
names .append (
228
228
f"{ object_meta .package_label } /{ object_meta .model_name } { self .template_name_suffix } .html"
229
229
)
You can’t perform that action at this time.
0 commit comments