示例#1
0
    def get_template_names(self):
        """
        Return a list of template names to be used for the request. Must return
        a list. May not be called if get_template is overridden.
        """
        try:
            names = TemplateResponseMixin.get_template_names(self)
        except ImproperlyConfigured:
            names = []

        if hasattr(self.object_list, '_document'):
            object_name = self.object_list._document.__name__
            names.append("%s/%s.html" % (object_name.lower(), self.template_name_suffix))

        return names
示例#2
0
    def get_template_names(self):
        """
        Return a list of template names to be used for the request. Must return
        a list. May not be called if get_template is overridden.
        """
        try:
            names = TemplateResponseMixin.get_template_names(self)
        except ImproperlyConfigured:
            names = []

        if hasattr(self.object_list, '_document'):
            object_name = self.object_list._document.__name__
            names.append("%s/%s.html" %
                         (object_name.lower(), self.template_name_suffix))

        return names
示例#3
0
 def get_template_names(self):
     return TemplateResponseMixin.get_template_names(self)
示例#4
0
 def value(self, view: TemplateResponseMixin) -> Optional[datetime.datetime]:
     t = select_template(view.get_template_names())
     local_tz = datetime.datetime.now().astimezone().tzinfo
     return datetime.datetime.fromtimestamp(os.stat(t.origin.name).st_mtime, tz=local_tz)