Skip to content

Commit

Permalink
Needs to import transaction.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Peters committed Mar 31, 2005
1 parent 9f0f98c commit 2d2e505
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions browser/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
$Id$
"""
import transaction

from zope.app import zapi
from zope.app.generations.interfaces import ISchemaManager
from zope.app.generations.generations import generations_key, Context
Expand All @@ -33,7 +35,7 @@ def _getdb(self):
return self.request.publication.db

def evolve(self):
"""Perform a requested evolution
"""Perform a requested evolution
This method needs to use the component architecture, so
we'll set it up:
Expand Down Expand Up @@ -88,7 +90,7 @@ def evolve(self):
We'll also increase the generation of app1:
>>> app1.generation = 2
Now we can create our view:
>>> view = Managers(None, request)
Expand All @@ -103,7 +105,7 @@ def evolve(self):
2
The demo evolver just writes the generation to a database key:
>>> from zope.app.generations.demo import key
>>> conn.root()[key]
(2,)
Expand Down Expand Up @@ -146,7 +148,7 @@ def evolve(self):
2
>>> conn.root()[key]
(2,)
We'd better clean upp:
>>> db.close()
Expand Down Expand Up @@ -232,7 +234,7 @@ def applications(self):
>>> app1.generation += 1
so we can evolve it.
Now we can create our view:
>>> view = Managers(None, request)
Expand All @@ -254,7 +256,7 @@ def applications(self):
evolve? evolve-app-foo.app1
foo.app2
0 0 0
evolve?
evolve?
We'd better clean upp:
Expand All @@ -273,7 +275,7 @@ def applications(self):
manager = managers.get(key)
if manager is None:
continue

result.append({
'id': key,
'min': manager.minimum_generation,
Expand Down

0 comments on commit 2d2e505

Please sign in to comment.