Django

Code

Changeset 3666

Show
Ignore:
Timestamp:
08/27/06 13:10:32 (2 years ago)
Author:
adrian
Message:

Reverted [3659], the 'name' field on Template objects and the signal emitted whenever a template is rendered. Refs #2333.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/template/defaulttags.py

    r3659 r3666  
    252252        if self.parsed: 
    253253            try: 
    254                 t = Template(output, name=self.filepath
     254                t = Template(output
    255255                return t.render(context) 
    256256            except TemplateSyntaxError, e: 
  • django/trunk/django/template/__init__.py

    r3659 r3666  
    6161from django.utils.functional import curry 
    6262from django.utils.text import smart_split 
    63 from django.dispatch import dispatcher 
    64 from django.template import signals 
    6563 
    6664__all__ = ('Template', 'Context', 'RequestContext', 'compile_string') 
     
    140138 
    141139class Template(object): 
    142     def __init__(self, template_string, origin=None, name='<Unknown Template>'): 
     140    def __init__(self, template_string, origin=None): 
    143141        "Compilation stage" 
    144142        if settings.TEMPLATE_DEBUG and origin == None: 
     
    147145            # came from... 
    148146        self.nodelist = compile_string(template_string, origin) 
    149         self.name = name 
    150147 
    151148    def __iter__(self): 
     
    156153    def render(self, context): 
    157154        "Display stage -- can be called many times" 
    158         dispatcher.send(signal=signals.template_rendered, sender=self, template=self, context=context) 
    159155        return self.nodelist.render(context) 
    160156 
  • django/trunk/django/template/loader.py

    r3659 r3666  
    7777    handling template inheritance recursively. 
    7878    """ 
    79     source, origin = find_template_source(template_name) 
    80     template = get_template_from_string(source, origin, template_name) 
    81     return template 
     79    return get_template_from_string(*find_template_source(template_name)) 
    8280 
    83 def get_template_from_string(source, origin=None, name=None): 
     81def get_template_from_string(source, origin=None): 
    8482    """ 
    8583    Returns a compiled Template object for the given template code, 
    8684    handling template inheritance recursively. 
    8785    """ 
    88     return Template(source, origin, name
     86    return Template(source, origin
    8987 
    9088def render_to_string(template_name, dictionary=None, context_instance=None): 
  • django/trunk/django/template/loader_tags.py

    r3659 r3666  
    5858            raise TemplateSyntaxError, "Template %r cannot be extended, because it doesn't exist" % parent 
    5959        else: 
    60             return get_template_from_string(source, origin, parent
     60            return get_template_from_string(source, origin
    6161 
    6262    def render(self, context): 
  • django/trunk/django/views/debug.py

    r3659 r3666  
    116116            'lineno': '?', 
    117117        }] 
    118     t = Template(TECHNICAL_500_TEMPLATE, name='Technical 500 Template'
     118    t = Template(TECHNICAL_500_TEMPLATE
    119119    c = Context({ 
    120120        'exception_type': exc_type.__name__, 
     
    142142            return empty_urlconf(request) 
    143143 
    144     t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 Template'
     144    t = Template(TECHNICAL_404_TEMPLATE
    145145    c = Context({ 
    146146        'root_urlconf': settings.ROOT_URLCONF, 
     
    155155def empty_urlconf(request): 
    156156    "Create an empty URLconf 404 error response." 
    157     t = Template(EMPTY_URLCONF_TEMPLATE, name='Empty URLConf Template'
     157    t = Template(EMPTY_URLCONF_TEMPLATE
    158158    c = Context({ 
    159159        'project_name': settings.SETTINGS_MODULE.split('.')[0] 
  • django/trunk/django/views/static.py

    r3659 r3666  
    8282        t = loader.get_template('static/directory_index') 
    8383    except TemplateDoesNotExist: 
    84         t = Template(DEFAULT_DIRECTORY_INDEX_TEMPLATE, name='Default Directory Index Template'
     84        t = Template(DEFAULT_DIRECTORY_INDEX_TEMPLATE
    8585    files = [] 
    8686    for f in os.listdir(fullpath):