[Zope3-checkins] CVS: Zope3/src/zope/app/generations/demo - __init__.py:1.1 evolve1.py:1.1 evolve2.py:1.1 evolve3.py:1.1

Jim Fulton jim at zope.com
Thu Apr 22 14:58:10 EDT 2004


Update of /cvs-repository/Zope3/src/zope/app/generations/demo
In directory cvs.zope.org:/tmp/cvs-serv12903/src/zope/app/generations/demo

Added Files:
	__init__.py evolve1.py evolve2.py evolve3.py 
Log Message:
Implemented a framework for orderly evolution of ZODB
application/database schemas:

http://dev.zope.org/Zope3/DatabaseGenerations

Included a schema manager for zope itself that simply establishes a
generation of 0.


=== Added File Zope3/src/zope/app/generations/demo/__init__.py ===
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Demo package for evolution scripts

The evolution scripts in this package are pretty dumb. The just call
the evolve function defined here with a generation number. 

$Id: __init__.py,v 1.1 2004/04/22 18:58:10 jim Exp $
"""

key = 'zope.app.generations.demo-generation'

def evolve(context, generation):
    """Demo that "evolves" a database.

    All it does is write the generation to a database root item.
    """
    root = context.connection.root()
    root[key] = root.get(key, ()) + (generation, )


=== Added File Zope3/src/zope/app/generations/demo/evolve1.py ===
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Silly demo evolution module

$Id: evolve1.py,v 1.1 2004/04/22 18:58:10 jim Exp $
"""

generation = 1

import zope.app.generations.demo

def evolve(context):
    zope.app.generations.demo.evolve(context, generation)


=== Added File Zope3/src/zope/app/generations/demo/evolve2.py ===
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Silly demo evolution module

$Id: evolve2.py,v 1.1 2004/04/22 18:58:10 jim Exp $
"""

generation = 2

import zope.app.generations.demo

def evolve(context):
    zope.app.generations.demo.evolve(context, generation)


=== Added File Zope3/src/zope/app/generations/demo/evolve3.py ===
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Silly demo evolution module

$Id: evolve3.py,v 1.1 2004/04/22 18:58:10 jim Exp $
"""

generation = 3

import zope.app.generations.demo

def evolve(context):
    zope.app.generations.demo.evolve(context, generation)




More information about the Zope3-Checkins mailing list