summaryrefslogtreecommitdiff
path: root/repoze
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-04-29 18:08:51 +0000
committerChris McDonough <chrism@agendaless.com>2010-04-29 18:08:51 +0000
commit7a3c22a7dcb688a637a6b9a0a317cf46f4d07af2 (patch)
tree5ffcb44af1451e9b23fcae816bcc99a14ea635d5 /repoze
parent0284cbdc978e0fd63474b9d97307677edefe8915 (diff)
downloadpyramid-7a3c22a7dcb688a637a6b9a0a317cf46f4d07af2.tar.gz
pyramid-7a3c22a7dcb688a637a6b9a0a317cf46f4d07af2.tar.bz2
pyramid-7a3c22a7dcb688a637a6b9a0a317cf46f4d07af2.zip
Next release
============ Paster Templates ---------------- - The ``bfg_alchemy`` and ``bfg_routesalchemy`` templates no longer register a ``handle_teardown`` event listener which calls ``DBSession.remove``. This was found by Chris Withers to be unnecessary. Documentation ------------- - The "bfgwiki2" (URL dispatch wiki) tutorial code and documentation was changed to remove the ``handle_teardown`` event listener which calls ``DBSession.remove``. - Any mention of the ``handle_teardown`` event listener as used by the paster templates was removed from the URL Dispatch narrative chapter.
Diffstat (limited to 'repoze')
-rw-r--r--repoze/bfg/paster_templates/alchemy/+package+/configure.zcml4
-rw-r--r--repoze/bfg/paster_templates/alchemy/+package+/run.py_tmpl11
-rw-r--r--repoze/bfg/paster_templates/routesalchemy/+package+/configure.zcml3
-rw-r--r--repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl11
4 files changed, 0 insertions, 29 deletions
diff --git a/repoze/bfg/paster_templates/alchemy/+package+/configure.zcml b/repoze/bfg/paster_templates/alchemy/+package+/configure.zcml
index 40b863c62..521f06ba4 100644
--- a/repoze/bfg/paster_templates/alchemy/+package+/configure.zcml
+++ b/repoze/bfg/paster_templates/alchemy/+package+/configure.zcml
@@ -20,8 +20,4 @@
path="templates/static"
/>
- <subscriber for="repoze.bfg.interfaces.INewRequest"
- handler=".run.handle_teardown"
- />
-
</configure>
diff --git a/repoze/bfg/paster_templates/alchemy/+package+/run.py_tmpl b/repoze/bfg/paster_templates/alchemy/+package+/run.py_tmpl
index 6ce86371b..3c2711028 100644
--- a/repoze/bfg/paster_templates/alchemy/+package+/run.py_tmpl
+++ b/repoze/bfg/paster_templates/alchemy/+package+/run.py_tmpl
@@ -1,17 +1,6 @@
-import transaction
-
from repoze.bfg.configuration import Configurator
-from repoze.tm import after_end
-from repoze.tm import isActive
from {{package}}.models import appmaker
-from {{package}}.models import DBSession
-
-def handle_teardown(event):
- environ = event.request.environ
- if isActive(environ):
- t = transaction.get()
- after_end.register(DBSession.remove, t)
def app(global_config, **settings):
""" This function returns a WSGI application.
diff --git a/repoze/bfg/paster_templates/routesalchemy/+package+/configure.zcml b/repoze/bfg/paster_templates/routesalchemy/+package+/configure.zcml
index 954be6bf8..1a8d3e0bf 100644
--- a/repoze/bfg/paster_templates/routesalchemy/+package+/configure.zcml
+++ b/repoze/bfg/paster_templates/routesalchemy/+package+/configure.zcml
@@ -3,9 +3,6 @@
<!-- this must be included for the view declarations to work -->
<include package="repoze.bfg.includes" />
- <subscriber for="repoze.bfg.interfaces.INewRequest"
- handler=".run.handle_teardown"/>
-
<route
path=""
name="home"
diff --git a/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl b/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl
index c4d37238a..61cc461cb 100644
--- a/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl
+++ b/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl
@@ -1,18 +1,7 @@
-import transaction
-
from repoze.bfg.configuration import Configurator
-from repoze.tm import after_end
-from repoze.tm import isActive
-from {{package}}.models import DBSession
from {{package}}.models import initialize_sql
-def handle_teardown(event):
- environ = event.request.environ
- if isActive(environ):
- t = transaction.get()
- after_end.register(DBSession.remove, t)
-
def app(global_config, **settings):
""" This function returns a WSGI application.