          # only use this if the object in question is a model.
          if isinstance(self.object, models.Model):
              names.append("%s/%s%s.html" % (
                  self.object._meta.app_label,
                  self.object._meta.object_name.lower(),
                  self.template_name_suffix
              ))
          elif hasattr(self, 'model') and self.model is not None and issubclass(self.model, models.Model):
              names.append("%s/%s%s.html" % (
                  self.model._meta.app_label,
 
</s> remove                 self.model._meta.object_name.lower(),
 </s> add                 self.model._meta.model_name, </s> remove             return self.field.rel.related_name or (self.opts.object_name.lower() + '_set')
 </s> add             return self.field.rel.related_name or (self.opts.model_name + '_set') </s> remove             names.append("%s/%s%s.html" % (opts.app_label, opts.object_name.lower(), self.template_name_suffix))
 </s> add             names.append("%s/%s%s.html" % (opts.app_label, opts.model_name, self.template_name_suffix)) </s> remove             return obj._meta.object_name.lower()
 </s> add             return obj._meta.model_name </s> remove         return self.user.has_perm("%s.%s" % (self.module_name, perm_name))
 </s> add         return self.user.has_perm("%s.%s" % (self.app_label, perm_name))
                self.object._meta.model_name,
          # only use this if the object in question is a model.
          if isinstance(self.object, models.Model):
              names.append("%s/%s%s.html" % (
                  self.object._meta.app_label,
                self.object._meta.model_name,
                  self.template_name_suffix
              ))
          elif hasattr(self, 'model') and self.model is not None and issubclass(self.model, models.Model):
              names.append("%s/%s%s.html" % (
                  self.model._meta.app_label,
keep keep keep keep replace keep keep keep keep keep
 Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`. 
django/views/generic/detail.py