Skip to content

Commit

Permalink
Merge branch '4.x' into issue_846
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Jun 17, 2020
2 parents ba6019b + 1808232 commit 845fbe7
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 45 deletions.
16 changes: 11 additions & 5 deletions CHANGES.rst
Expand Up @@ -7,22 +7,28 @@ The change log for the previous version, Zope 2.13, is at
https://zope.readthedocs.io/en/2.13/CHANGES.html


4.4.3 (unreleased)
4.4.4 (unreleased)
------------------

- Fix ``default`` keyword handling in page templates
(`#846 <https://github.com/zopefoundation/Zope/issues/846>`_)

- Fix parsing of package version and show correct major version in the ZMI
- Update dependencies to newest bugfix releases.

- Update dependencies to newest releases.

4.4.3 (2020-06-16)
------------------

- Fix parsing of package version and show correct major version in the ZMI.

- Improve solidity of the ``debugError`` method.
(`#829 <https://github.com/zopefoundation/Zope/issues/829>`_)

- Use ``Chameleon`` (>= 3.7.2) configuration to get better
information for errors detected during template execution
(`#837 <https://github.com/zopefoundation/Zope/issues/837>`_).
information for errors detected during template execution.
(`#837 <https://github.com/zopefoundation/Zope/issues/837>`_)

- Update dependencies to newest releases.


4.4.2 (2020-04-30)
Expand Down
4 changes: 2 additions & 2 deletions constraints.txt
Expand Up @@ -8,7 +8,7 @@ DocumentTemplate==3.2.3
ExtensionClass==4.4
Missing==4.1
MultiMapping==4.1
Paste==3.4.0
Paste==3.4.1
PasteDeploy==2.1.0
Persistence==3.0
Products.BTreeFolder2==4.2
Expand Down Expand Up @@ -36,7 +36,7 @@ roman==3.2
shutilwhich==1.1.0
six==1.14.0
transaction==3.0.0
waitress==1.4.3
waitress==1.4.4
z3c.pt==3.3.0
zExceptions==4.1
zc.lockfile==2.0
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Expand Up @@ -20,13 +20,13 @@
# -- Project information -----------------------------------------------------

project = 'Zope documentation'
copyright = '2009-2019, The Zope developer community'
copyright = '2009-2020, The Zope developer community'
author = 'The Zope developer community'

# The short X.Y version
version = '4.1'
version = '4.4'
# The full version, including alpha/beta/rc tags
release = '4.1'
release = '4.4'


# -- General configuration ---------------------------------------------------
Expand Down
Binary file modified docs/zopebook/Figures/zoo1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 27 additions & 22 deletions docs/zopebook/SimpleExamples.rst
@@ -1,12 +1,16 @@
Creating Basic Zope Applications
================================

.. include:: includes/zope2_notice.rst

.. todo:
- add new screen shots
.. note::

In order to create objects of type `Script (Python)` make sure to also
install the package ``Products.PythonScripts``.


This chapter will take you, step by step, through building a basic web
application in Zope. As we go through the chapter, we will examine some of
Zope's main concepts at work. Using Zope *Folder*, *Script (Python)*, and
Expand Down Expand Up @@ -70,15 +74,14 @@ familiar with the ZMI, refer to the `Installing and Starting Zope

1. Navigate to Zope's top-level *root* folder.

2. Use the *Add* list to create a new *Folder*.
2. Use the *Select type to add* dropdown to create a new *Folder*. (We will
refer to this dropdown as "*Add* list" from here on out)

3. Give the new folder the *Id* 'ZopeZoo'.

4. Check *Create public interface*.

5. Click *Add*.
4. Click *Add*.

(For now, we will ignore the optional *Title* fields.)
(For now, we will ignore the optional *Title* field.)

Designing a Navigable Zoo
-------------------------
Expand Down Expand Up @@ -113,9 +116,10 @@ Step 2: Create Site Organization
'Lizards' and 'Snakes'.

In Zope's Navigator frame on the left side, you should see an icon for the
*ZopeZoo* folder. (If you don't see it, click *Refresh* in the Navigator).
*ZopeZoo* folder. (If you don't see it, click on the cogwheel icon and then
click *Refresh* in the Navigator).
To view the *ZopeZoo* folder hierarchy - i.e. our nascent web site's
structure - expand the *ZopeZoo* folder by clicking the little plus sign
structure - expand the *ZopeZoo* folder by clicking the little triangle
next to the icon. Similarly expand the zoo subfolders. You'll see
something like the figure below.

Expand Down Expand Up @@ -174,9 +178,15 @@ Step 3: Create the Style Sheet
At this stage, the HTML page the web designer created for us is valid XHTML
1.0 Strict and could also live in a static *File* object. But in the next
steps we will convert the page into a dynamic template by adding TAL and
METAL statements, so we need a *Page Template* object. For now we use the
*index_html* method already added by selecting *Create public interface* in
step 1.
METAL statements, so we need a *Page Template* object:

1. Go back to the top level of our zoo website, the *ZopeZoo* folder.

2. Select *Page Template* from the *Add* list.

3. Give the Page Template an *Id* of 'index_html'.

4. Click *Add*.

Step 4: Create the Main Template
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -185,8 +195,7 @@ Step 4: Create the Main Template

2. Replace all of the stock template code with this::

<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<!DOCTYPE html>
<html>
<head>

Expand Down Expand Up @@ -362,8 +371,7 @@ Step 10: Factor out Basic Look and Feel
all these changes our main template - now called *z_zoo.pt* - looks
like this::

<metal:macro metal:define-macro="page"><!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<metal:macro metal:define-macro="page"><!DOCTYPE html>
<html>
<head>

Expand Down Expand Up @@ -530,16 +538,13 @@ Step 14: Adding *index_html* Script and Template
1. Within the *Files* folder, add this new *Script (Python)* with the
*Id* 'index_html'::

## Script (Python) "index_html"
##parameters=
##
library_items = []
items = context.objectValues(['File'])
for item in items:
library_items.append(
{ 'title': item.title_or_id(),
'url': item.absolute_url(),
'modified': item.bobobase_modification_time().aCommon()
'modified': container.last_modified(item),
} )

options = { 'library_items': tuple(library_items) }
Expand Down Expand Up @@ -653,15 +658,15 @@ Step 16: Making the Library Sortable
sort_title_url = ''
sort_modified_url = '%s?sort=modified' % context.absolute_url()
else:
sort_on = ( ('bobobase_modification_time', 'cmp', 'desc'), )
sort_on = ( ('_p_mtime', 'cmp', 'desc'), )
sort_title_url = '%s?sort=title' % context.absolute_url()
sort_modified_url = ''
items = sequence.sort(items, sort_on)
for item in items:
library_items.append(
{ 'title': item.title_or_id(),
'url': item.absolute_url(),
'modified': item.bobobase_modification_time().aCommon()
'modified': container.last_modified(item),
} )

options = { 'sort_title_url': sort_title_url,
Expand Down
4 changes: 2 additions & 2 deletions requirements-full.txt
Expand Up @@ -9,7 +9,7 @@ DocumentTemplate==3.2.3
ExtensionClass==4.4
Missing==4.1
MultiMapping==4.1
Paste==3.4.0
Paste==3.4.1
PasteDeploy==2.1.0
Persistence==3.0
Products.BTreeFolder2==4.2
Expand All @@ -36,7 +36,7 @@ roman==3.2
shutilwhich==1.1.0
six==1.14.0
transaction==3.0.0
waitress==1.4.3
waitress==1.4.4
z3c.pt==3.3.0
zExceptions==4.1
zc.lockfile==2.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -29,7 +29,7 @@ def _read_file(filename):
README = _read_file('README.rst')
CHANGES = _read_file('CHANGES.rst')

version = '4.4.3.dev0'
version = '4.4.4.dev0'


setup(
Expand Down
4 changes: 2 additions & 2 deletions versions-prod.cfg
Expand Up @@ -14,7 +14,7 @@ DocumentTemplate = 3.2.3
ExtensionClass = 4.4
Missing = 4.1
MultiMapping = 4.1
Paste = 3.4.0
Paste = 3.4.1
PasteDeploy = 2.1.0
Persistence = 3.0
Products.BTreeFolder2 = 4.2
Expand Down Expand Up @@ -42,7 +42,7 @@ roman = 3.2
shutilwhich = 1.1.0
six = 1.14.0
transaction = 3.0.0
waitress = 1.4.3
waitress = 1.4.4
z3c.pt = 3.3.0
zExceptions = 4.1
zc.lockfile = 2.0
Expand Down
16 changes: 8 additions & 8 deletions versions.cfg
Expand Up @@ -12,7 +12,7 @@ Pygments = 2.5.2
# Version 2.0+ needs Python 3.x
Sphinx = 1.8.5
alabaster = 0.7.12
appdirs = 1.4.3
appdirs = 1.4.4
attrs = 19.3.0
backports.functools-lru-cache = 1.6.1
beautifulsoup4 = 4.8.2
Expand All @@ -36,7 +36,7 @@ idna = 2.9
imagesize = 1.2.0
# tox and pluggy require importlib-metadata <1
importlib-metadata = 0.23
lxml = 4.5.0
lxml = 4.5.1
manuel = 1.10.1
# Version 6+ needs Python 3.x
more-itertools = 5.0.0
Expand All @@ -48,7 +48,7 @@ pip = 20.0.2
pkginfo = 1.5.0.1
plone.recipe.command = 1.1
pluggy = 0.13.1
py = 1.8.1
py = 1.8.2
pycparser = 2.19
pyparsing = 2.4.7
python-gettext = 4.0
Expand All @@ -59,17 +59,17 @@ requests-toolbelt = 0.9.1
scandir = 1.10.0
snowballstemmer = 2.0.0
# soupsieve 2 needs Python 3
soupsieve = 1.9.5
soupsieve = 1.9.6
sphinx-rtd-theme = 0.4.3
sphinxcontrib-websupport = 1.2.1
toml = 0.10.0
sphinxcontrib-websupport = 1.2.2
toml = 0.10.1
tox = 3.14.6
tqdm = 4.43.0
# Version 2+ needs Python 3.x
twine = 1.15.0
typing = 3.7.4.1
urllib3 = 1.25.8
virtualenv = 20.0.15
urllib3 = 1.25.9
virtualenv = 20.0.23
webencodings = 0.5.1
wheel = 0.34.2
z3c.checkversions = 1.1
Expand Down

0 comments on commit 845fbe7

Please sign in to comment.