Skip to content

Commit

Permalink
- reorganized Zope 4 migration documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Apr 7, 2019
1 parent 37b325d commit 5f9ba7f
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 44 deletions.
45 changes: 42 additions & 3 deletions docs/zope4/migration/zmi.rst → docs/zope4/migration/code.rst
@@ -1,3 +1,45 @@
Migrating Zope product code
===========================
The following list shows a few common migration issues independent of the
Python version used.

.. contents::
:local:


Changed import paths
--------------------
Several commonly used Zope code modules have moved. Here's a short list of
corrections you will have to make in your code. Many of these changed paths
have already existed under Zope 2, so you can make those corrections ahead of
time.

.. code-block:: python
from Globals import InitializeClass # OLD
from AccessControl.class_init import InitializeClass # NEW
``implementer`` versus ``implements``
-------------------------------------
How to signal that a class implements a specific interface has moved from a
function called at class level into a class decorator and changed its name:

.. code-block:: python
from zope.interface import implementer
from zope.interface import implements
from .interfaces import IMyClass
class MyClass:
implements(IMyClass) # OLD
...
@implementer(IMyClass) # NEW
class AnotherClass:
...
.. _ZMI-label:

Migrating to the new bootstrap-based ZMI
Expand All @@ -10,9 +52,6 @@ by Bootstrap.
The free Font Awesome glyphs are used as icons, see the table of
`available icons`_.

.. contents::
:local:

Update existing package code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you have a Product or package which contains types, which can be added via
Expand Down
@@ -1,45 +1,12 @@
Common migration issues
=======================
The following list shows a few common migration issues independent of the
Python version used. Suggestions for additions are always welcome.
Migrating content
=================
These issues may appear when rendering content (templates, scripts or
other built-in Zope code objects) created with Zope 2 in Zope 4.

.. contents::
:local:


Changed import paths
--------------------
Several commonly used Zope code modules have moved. Here's a short list of
corrections you will have to make in your code. Many of these changed paths
have already existed under Zope 2, so you can make those corrections ahead of
time.

.. code-block:: python
from Globals import InitializeClass # OLD
from AccessControl.class_init import InitializeClass # NEW
``implementer`` versus ``implements``
-------------------------------------
How to signal that a class implements a specific interface has moved from a
function called at class level into a class decorator and changed its name:

.. code-block:: python
from zope.interface import implementer
from zope.interface import implements
from .interfaces import IMyClass
class MyClass:
implements(IMyClass) # OLD
...
@implementer(IMyClass) # NEW
class AnotherClass:
...
Page Template parsing issues
----------------------------
Zope 4 is using `Chameleon <https://chameleon.readthedocs.io>`_ as its new
Expand Down
4 changes: 2 additions & 2 deletions docs/zope4/migration/index.rst
Expand Up @@ -5,6 +5,6 @@ Migrating to Zope 4
:maxdepth: 2

removed
common
zmi
code
content
zodb
4 changes: 2 additions & 2 deletions docs/zope4/migration/zodb.rst
@@ -1,5 +1,5 @@
Migrating the ZODB from Zope 2 to Zope 4
========================================
Migrating the ZODB
==================
This document describes the process of migrating a ZODB created with Zope 2
into a Zope 4 environment.

Expand Down

0 comments on commit 5f9ba7f

Please sign in to comment.