Show
Ignore:
Timestamp:
06/29/07 16:05:08 (3 years ago)
Author:
JensDiemer
Message:

* new additional Stylesheet/JavaScript handling. A middleware puts the collected data into the page.
* middleware "pagestats" renamed to "additional_content".
* some code cleanup

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.8(django)/PyLucid/tools/content_processors.py

    r1101 r1127  
     1#!/usr/bin/python 
     2# -*- coding: UTF-8 -*- 
    13 
    24""" 
     
    9395 
    9496 
    95 def render_string_template(template, context): 
    96     """ 
    97     Render a string-template with the given context 
    98     """ 
    99     context = Context(context) 
    100     template = Template(template) 
    101     html = template.render(context) 
    102     return html 
    103  
    104 def render_template(content, global_context, local_context={}): 
     97def render_string_template(content, context): 
    10598    """ 
    10699    Render a template. 
    107     1. put all local context items in the global context 
    108     2. render with the merged context 
    109     Note: 
    110     - The local_context are content for a internal page. 
    111     - We merged the local- and global-context together, so every internal 
    112     page can display something from the global context, like page name... 
    113100    """ 
    114     global_context.update(local_context) 
    115  
    116     html = render_string_template(content, global_context) 
    117  
     101    context2 = Context(context) 
     102    template = Template(content) 
     103    html = template.render(context2) 
    118104    return html