[Zope3-Users] beginning orientation
Tom Dossis
td at yoma.com.au
Mon Dec 13 19:04:23 EST 2004
Martin Blais wrote:
> hello,
>
> i'm new to zope, currently trying to learn as much as i can from it,
> in order to investigate whether to use it for a new project (rather
> than go the cgi+sql way). i read the zope3 developer's book, it seems
> really well-done, but i have a few concerns and questions:
>
> 1. it would be nice if there was a section/chapter on debugging problems.
I found the following useful, even though it's for zope2.
http://www.zopewiki.org/ConversingWithZope
For zope3, there's a DEBUG.txt file in the doco. Using ZEO is useful to
allow multiple connections to the ZODB. Here's snippet from a specific
app. of mine...
import os, os.path
import ZODB
import ZEO.ClientStorage
import zope.app.debug
_root = None
def getRoot(host='localhost', port=9999):
global _root
if _root is None:
instance_home = os.environ.get('INSTANCE_HOME', './')
zcml = os.path.join(instance_home, 'etc', 'site.zcml')
storage = ZEO.ClientStorage.ClientStorage((host, port))
db = ZODB.DB(storage)
_root = zope.app.debug.Debugger(db, zcml).root()
return _root
Example:
>>> import zopeclient
>>> root = zopeclient.getRoot()
>>> root
<zope.app.folder.folder.Folder object at 0x4121332c>
>
> 2. it would be nice if there was section that described the syntax of
> queries to the server? I noticed URL someitmes have a
> ..../@@page.html -like syntax, but changing the urls i manage to get
> pages without that. i couldn't find a section that explains how this
> works. i'm not familiar with zope2, perhaps this is something taht is
> in the docs for zope2...
>
> 3. normally i'd use an SQL database or files to store data, but I
> understand that zope includes an object database. i suppose a trivial
> way to think about this would be to create classes and then each
> "database row" would correspond to an object instance stored in a
> folder (itself corresponding to an SQL table).
Perhaps a closer analogy of typical use would be: a file sytems
directory/file (container/contained) hierachy.
>
> will this allow me to run offline processes accessing the data as I
> would an SQL database, say iterating over the object instances and
> then modifying some data in these objects?
Yes you can traverse the zope object store. You could do this in the
context of the Zope application - or in another context via ZEO.
is this efficient
> comparing to a typical MySQL setup? where can i find out more about
> how to go about this?
Probably nowhere near as fast for writing. It's also import to be aware
of 'packing' the ZODB. Every object modification leaves the previous
version around. Keep an eye on the ZODB size AND the zope app memory
usage when you do large numbers of mods.
>
> 4. i understand that many of the zope devs are also plone devs. is
> there an alpha/in-the-works version of plone for zope3? if not, how
> much work would it be to implement per-user profile information and
> email-verification registration procedure? i would be willing to
> contribute code if i decide to work on this thing (at this point i'm
> not sure that coding my stuff by hand would take less time)
>
> thx for any pointer, i'm a bit lost in the sea of zope concepts...
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>
More information about the Zope3-users
mailing list