Permalink
Browse files

* Fixed template for Session.remove inclusion when using SA. Fixed

  render_genshi to properly use fragment/format options. Thanks Antonin
  Enfrun.

--HG--
branch : trunk
  • Loading branch information...
bbangert committed Mar 16, 2008
1 parent eb6548e commit 6634e763476451fcb28c2d207c016c8824419740
Showing with 18 additions and 4 deletions.
  1. +3 −0 CHANGELOG
  2. +10 −0 pylons/templates/default_project/+package+/lib/base.py_tmpl
  3. +4 −3 pylons/templating.py
  4. +1 −1 setup.py
View
@@ -2,6 +2,9 @@ Pylons Changelog
=================
0.9.7 (**tip**)
+* Fixed template for Session.remove inclusion when using SA. Fixed
+ render_genshi to properly use fragment/format options. Thanks Antonin
+ Enfrun.
* Remove template engine from load_environment call.
* Removing template controller from projects. Fixes #383.
* Added signed_cookie method to WebOb Request/Response sub-classes.
@@ -3,6 +3,9 @@
Provides the BaseController class for subclassing.
"""
from pylons.controllers import WSGIController
+{{if sqlalchemy}}
+from {{package}}.model import meta
+{{endif}}
class BaseController(WSGIController):
@@ -11,4 +14,11 @@ class BaseController(WSGIController):
# WSGIController.__call__ dispatches to the Controller method
# the request is routed to. This routing information is
# available in environ['pylons.routes_dict']
+ {{if sqlalchemy}}
+ try:
+ return WSGIController.__call__(self, environ, start_response)
+ finally:
+ meta.Session.remove()
+ {{else}}
return WSGIController.__call__(self, environ, start_response)
+ {{endif}}
View
@@ -280,14 +280,14 @@ def render_template():
def render_genshi(template_name, cache_key=None, cache_type=None,
- cache_expire=None, fragment=False, format='xhtml'):
+ cache_expire=None, fragment=False, format=None):
"""Render a template with Genshi
Accepts the cache options ``cache_key``, ``cache_type``, and
``cache_expire`` in addition to fragment and format which are
passed to Genshi's render function.
- """
+ """
# Create a render callable for the cache function
def render_template():
# First, get the globals
@@ -296,7 +296,8 @@ def render_template():
# Grab a template reference
template = globs['g'].genshi_loader.load(template_name)
- return template.generate(**globs).render()
+ return template.generate(**globs).render(fragment=fragment,
+ format=format)
return cached_template(template_name, render_template, cache_key=cache_key,
cache_type=cache_type, cache_expire=cache_expire,
View
@@ -5,7 +5,7 @@
use_setuptools()
from setuptools import setup, find_packages
-version = '0.9.7beta1'
+version = '0.9.7beta2'
setup(
name="Pylons",

0 comments on commit 6634e76

Please sign in to comment.