/>
>
> where context is the Car object.
This is wrong, because Car does not have a function called getTotalDistance.
In the view class do:
class View:
def getTotalDistance(self):
total = interfaces.IDistanceTotal(self.context)
return total.getTotalDistance()
In the view do:
Note that you should never ever put a python call into your template.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
From srichter at cosmos.phy.tufts.edu Sat Nov 12 08:12:34 2005
From: srichter at cosmos.phy.tufts.edu (Stephan Richter)
Date: Sat Nov 12 08:12:36 2005
Subject: [Zope3-Users] documentation on Field types
In-Reply-To: <20051104050739.GZ4731@wheat.boylan.org>
References: <20051104050739.GZ4731@wheat.boylan.org>
Message-ID: <200511120812.34684.srichter@cosmos.phy.tufts.edu>
On Friday 04 November 2005 00:07, Ross Boylan wrote:
> Where should I look for documentation on Field types? ?By this, I mean
> a current, exhaustive list of allowed Field types and their arguments.
There is none.
> I suspect when I go to the API documentation and enter zope.schema I'm
> getting the values, with some translation. ?But since those entries
> are in terms of interfaces and not the actual names to use (e.g.,
> IText, not Text), I'd like to know more about how they relate.
Well, all data fields defined in those interfaces are keyword arguments in the
constructor.
> The "Programming with Zope 3" Tutorial and Richter's Developer's
> Handbook both discuss and list various options, but they have several
> limitations:
> * they aren't current
> * they aren't exhaustive
> * they aren't in the online help system.
>
> I'm looking for something that meets those requirements.
Look at zope.schema._field and zope.schema._bootstrapfields
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
From srichter at cosmos.phy.tufts.edu Sat Nov 12 08:19:13 2005
From: srichter at cosmos.phy.tufts.edu (Stephan Richter)
Date: Sat Nov 12 08:19:15 2005
Subject: [Zope3-Users] Complex Adapter Requirements - Named Adapters?
In-Reply-To: <36d212000510301116v1f2ca3d3v@mail.gmail.com>
References: <36d212000510301116v1f2ca3d3v@mail.gmail.com>
Message-ID: <200511120819.13727.srichter@cosmos.phy.tufts.edu>
On Sunday 30 October 2005 14:16, James Allwyn wrote:
> One thought I had, was creating an interface IStandard, with
> attributes like "meetsstandard" and "nameofstandard", and then
> subclass this, e.g. to IAccreditationScheme and INationalCode (where
> "Accreditation Scheme" and "National Code" are the names of two of the
> standards). But I get a little stuck conceptually at the point where I
> try to handle, for example, the fact that for some ISharedHouse
> objects, IAccreditationScheme would be suitable, whilst for others it
> wouldn't, because of their location. In fact it's likely that in the
> future we will need to recognise two or more standards for a
> particular accommodation type (so IAccreditationScheme and IHouseCheck
> chould both apply to ISharedHouse objects, in differect areas).
This is not such a complex case as you think.
If you register an adapter from ISharedHouse to IAccreditationScheme then it
will be only available for this interface and not for IAccommodation in
general. I would even write a specific IAccreditationScheme for every scheme
you support; thus you do not even need named adapters.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
From alecmunro at gmail.com Sat Nov 12 11:40:55 2005
From: alecmunro at gmail.com (Alec Munro)
Date: Sat Nov 12 11:40:57 2005
Subject: [Zope3-Users] Recommended policy for extension of the built-in
skins and macros?
Message-ID: <9819d58b0511120840s8d52679v180b83f74535f0f@mail.gmail.com>
Hi All,
I've managed to dip my toes rather deeply in Zope3 without ever
approaching the skins/layers aspect of it. I'm finally in a position
to do that, and most of the examples I find extend the Rotterdam skin,
and simply override it's macros.
Is this simply for convenience, as there is a lot of useful
functionality provided by these macros? Or is there some grander
reason for using the existing with simple customizations?
The main thing I could think of was that by doing this, you will can
generally ensure consistent macro naming across different sites, which
I suppose is helpful.
I'm a very minimalist guy as far as HTML goes, so my initial
inclination is generally to start with with the simplest thing
possible, and expand it when necessary.
What are people's experiences with this (keeping in mind that I am
likely misunderstanding some large part of the way skins and layers
are supposed to work :) ?
Thanks,
Alec Munro
From philipp at weitershausen.de Sat Nov 12 14:03:23 2005
From: philipp at weitershausen.de (Philipp von Weitershausen)
Date: Sat Nov 12 14:04:25 2005
Subject: [Zope3-Users] Re: Zope3 design question
In-Reply-To:
References: <43737E1F.3090208@weitershausen.de>
Message-ID: <43763C7B.5090705@weitershausen.de>
rubberduckee wrote:
>>We've once had the ability of editing schemas TTW, but I'm not sure if
>>this is still the case. At least I don't think it's part of a release
>>tarball of Zope 3.
>>
>>Philipp
>
> Thanks, will do that in the future. Do you know why this particular
> feature was 'dropped'?
Well, something that hasn't been released in the first place can't be
dropped. The problem is that it just hasn't been maintained lately
because other things were the priority. This might change in the future
and anyone's welcome to contribute. The current code is mostly at
zope.app.schemacontent.
Philipp
From philipp at weitershausen.de Sat Nov 12 14:28:26 2005
From: philipp at weitershausen.de (Philipp von Weitershausen)
Date: Sat Nov 12 14:29:50 2005
Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM
In-Reply-To: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com>
References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com>
Message-ID: <4376425A.9050807@weitershausen.de>
Simon Hang wrote:
> Dear all,
>
> I'm trying to use apache as zope3's frontend, and do NTLM authentication
> as well.
Well, traditionally it's been part of Zope's responsibility to do
credentials extraction and user authentication. That doesn't mean it
couldn't be done by the webserver in front of Zope; there might just be
other implications that you and I can't think of ;).
> I've done:
> 1. Installed mod_ntlm for apache 1.3, and tested.
> 2. Create a VirtualHost for zope3 instance, forwarding http request
> using rewrite engine. And tested.
>
> Now I try to put things together => A virtualhost can do NTLM
> authentication and forward request to zope3, my virtual configration of
> apache as below:
>
>
> DocumentRoot c:/myroot
> Servername myserver
> ErrorLog logs/myerror.log
> CustomLog logs/myaccess.log common
> RewriteEngine On
> RewriteRule ^(/?.*)
> http://localhost:8080/++vh++http:myserver:808/++$1 [P,L]
>
>
> AuthName "realm"
> AuthType NTLM
> NTLMAuth On
> NTLMAuthoritative On
> NTLMDomain mydomain
> NTLMOfferBasic Off
> NTLMBasicPreferred Off
> require valid-user
>
>
>
>
> Everytime I try to access the page, the brower show me error message as
> below:
>
>
> Authorization Required
>
> This server could not verify that you are authorized to access the
> document requested. Either you supplied the wrong credentials (e.g., bad
> password), or your browser doesn't understand how to supply the
> credentials required.
>
> What's wrong in my settings?
Well, Zope 3 doesn't care that Apache has authenticated your user. It
doesn't see that. If you want the Zope 3 security system to interact
with Apache's, here's a suggestion (not sure if it'll actually work):
- Have Apache forward the REMOTE_USER CGI env variable, e.g. by using
the "E" flag at the end of rewrite rule:
[P,L,E=REMOTE_USER:%{REMOTE_USER}]
- Have a custom ICredentialsPlugin that's simply looks at this env
variable in the request for the log-in credentials. To challenge the
user for authentication, it would simply use the same authentication
realm as set in the apache.conf, so that it gets picked up by Apache
when the user provides the credentials.
- Have a custom IAuthenticatorPlugin that uses the credential data of
the former plug-in to create a principal object from it. It wouldn't
really need to do any actual authentication because that had already
been done by Apache. The only thing this plug-in needs to do is convert
the credentials data into an actual principal object.
Hope that helps.
Philipp
From fg at nuxeo.com Sat Nov 12 14:36:27 2005
From: fg at nuxeo.com (Florent Guillaume)
Date: Sat Nov 12 14:36:30 2005
Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM
In-Reply-To: <4376425A.9050807@weitershausen.de>
References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com>
<4376425A.9050807@weitershausen.de>
Message-ID: <4376443B.7060809@nuxeo.com>
Philipp von Weitershausen wrote:
> Simon Hang wrote:
>
>>Dear all,
>>
>>I'm trying to use apache as zope3's frontend, and do NTLM authentication
>>as well.
>
>
> Well, traditionally it's been part of Zope's responsibility to do
> credentials extraction and user authentication. That doesn't mean it
> couldn't be done by the webserver in front of Zope; there might just be
> other implications that you and I can't think of ;).
>
>
>>I've done:
>>1. Installed mod_ntlm for apache 1.3, and tested.
>>2. Create a VirtualHost for zope3 instance, forwarding http request
>>using rewrite engine. And tested.
>>
>>Now I try to put things together => A virtualhost can do NTLM
>>authentication and forward request to zope3, my virtual configration of
>>apache as below:
>>
>>
>> DocumentRoot c:/myroot
>> Servername myserver
>> ErrorLog logs/myerror.log
>> CustomLog logs/myaccess.log common
>> RewriteEngine On
>> RewriteRule ^(/?.*)
>>http://localhost:8080/++vh++http:myserver:808/++$1 [P,L]
>>
>>
>> AuthName "realm"
>> AuthType NTLM
>> NTLMAuth On
>> NTLMAuthoritative On
>> NTLMDomain mydomain
>> NTLMOfferBasic Off
>> NTLMBasicPreferred Off
>> require valid-user
>>
>>
>>
>>
>>Everytime I try to access the page, the brower show me error message as
>>below:
>>
>>
>> Authorization Required
>>
>>This server could not verify that you are authorized to access the
>>document requested. Either you supplied the wrong credentials (e.g., bad
>>password), or your browser doesn't understand how to supply the
>>credentials required.
>>
>>What's wrong in my settings?
>
>
> Well, Zope 3 doesn't care that Apache has authenticated your user. It
> doesn't see that. If you want the Zope 3 security system to interact
> with Apache's, here's a suggestion (not sure if it'll actually work):
>
> - Have Apache forward the REMOTE_USER CGI env variable, e.g. by using
> the "E" flag at the end of rewrite rule:
>
> [P,L,E=REMOTE_USER:%{REMOTE_USER}]
Will that really work? env variables are only useful in CGI mode, but
proxying doesn't involve CGI. Rather I'd advise using additional
parameters to the URL, like we do here for Zope 2 for instance:
http://svn.nuxeo.org/trac/pub/file/CMFNtlmSso/trunk/doc/vhost_sso.conf
> - Have a custom ICredentialsPlugin that's simply looks at this env
> variable in the request for the log-in credentials. To challenge the
> user for authentication, it would simply use the same authentication
> realm as set in the apache.conf, so that it gets picked up by Apache
> when the user provides the credentials.
And this plugin would have to get the credentials from the URL instead
of the env variable. I wish apache had a proper way to add request
headers during proxying...
Florent
>
> - Have a custom IAuthenticatorPlugin that uses the credential data of
> the former plug-in to create a principal object from it. It wouldn't
> really need to do any actual authentication because that had already
> been done by Apache. The only thing this plug-in needs to do is convert
> the credentials data into an actual principal object.
>
> Hope that helps.
>
> Philipp
--
Florent Guillaume, Nuxeo (Paris, France) Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
From philipp at weitershausen.de Sat Nov 12 15:01:41 2005
From: philipp at weitershausen.de (Philipp von Weitershausen)
Date: Sat Nov 12 15:01:42 2005
Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM
In-Reply-To: <4376443B.7060809@nuxeo.com>
References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com>
<4376425A.9050807@weitershausen.de> <4376443B.7060809@nuxeo.com>
Message-ID: <43764A25.10700@weitershausen.de>
Florent Guillaume wrote:
>> Well, Zope 3 doesn't care that Apache has authenticated your user. It
>> doesn't see that. If you want the Zope 3 security system to interact
>> with Apache's, here's a suggestion (not sure if it'll actually work):
>>
>> - Have Apache forward the REMOTE_USER CGI env variable, e.g. by using
>> the "E" flag at the end of rewrite rule:
>>
>> [P,L,E=REMOTE_USER:%{REMOTE_USER}]
>
>
> Will that really work? env variables are only useful in CGI mode, but
> proxying doesn't involve CGI. Rather I'd advise using additional
> parameters to the URL, like we do here for Zope 2 for instance:
>
> http://svn.nuxeo.org/trac/pub/file/CMFNtlmSso/trunk/doc/vhost_sso.conf
Ah, yes. I thought of this initially but found the env way to be
cleaner, simply assuming that mod_rewrite would pass the current env
along on the proxy request. It seems it doesn't.
Good example config, by the way.
>> - Have a custom ICredentialsPlugin that's simply looks at this env
>> variable in the request for the log-in credentials. To challenge the
>> user for authentication, it would simply use the same authentication
>> realm as set in the apache.conf, so that it gets picked up by Apache
>> when the user provides the credentials.
>
>
> And this plugin would have to get the credentials from the URL instead
> of the env variable. I wish apache had a proper way to add request
> headers during proxying...
Yup and yup.
Philipp
From pkoppatz at web.de Sat Nov 12 16:06:31 2005
From: pkoppatz at web.de (Peter Koppatz)
Date: Sat Nov 12 16:06:43 2005
Subject: [Zope3-Users] error on start
Message-ID: <6895AD0C-C405-4AFC-94B9-FB6D6948EB31@web.de>
Hello,
I performed the following steps:
svn co svn://svn.zope.org/repos/main/Zope3/trunk Zope3
(At revision 40077.)
cd Zope3
/usr/local/bin/python2.4 setup.py -q build_ext -i
cp sample_principals.zcml principals.zcml
/usr/local/bin/python2.4 z3.py
and I got the following output:
AttributesNSImpl(newattrs, qnames))
File "/Users/peter/programme/Zope3/src/zope/configuration/
xmlconfig.py", line 222, in startElementNS
self.context.begin(name, data, info)
File "/Users/peter/programme/Zope3/src/zope/configuration/
config.py", line 550, in begin
self.stack.append(self.stack[-1].contained(__name, __data, __info))
File "/Users/peter/programme/Zope3/src/zope/configuration/
config.py", line 849, in contained
return RootStackItem.contained(self, name, data, info)
File "/Users/peter/programme/Zope3/src/zope/configuration/
config.py", line 717, in contained
factory = self.context.factory(self.context, name)
File "/Users/peter/programme/Zope3/src/zope/configuration/
config.py", line 496, in factory
raise ConfigurationError("Unknown directive", ns, n)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Users/
peter/programme/Zope3/site.zcml", line 13.2-13.40
ZopeXMLConfigurationError: File "/Users/peter/programme/Zope3/
securitypolicy.zcml", line 11.2
ConfigurationError: ('Unknown directive', u'http://
namespaces.zope.org/zope', u'role')
What is the missing part?
Peter
From hangzhiyun at gmail.com Sat Nov 12 18:48:40 2005
From: hangzhiyun at gmail.com (Simon Hang)
Date: Sat Nov 12 18:48:41 2005
Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM
In-Reply-To: <43764A25.10700@weitershausen.de>
References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com>
<4376425A.9050807@weitershausen.de> <4376443B.7060809@nuxeo.com>
<43764A25.10700@weitershausen.de>
Message-ID: <8a8e599a0511121548g3728ef4fl74a5833b5da428dc@mail.gmail.com>
Thanks for the help.
I feel not comfortable to put the username in URL. User may be able to
bypass the authentication and direct access zope with username in URL.
And that's true, Apache can pass environment variable via mod_rewrite.
What's a pity.
Now the only solution I found is only working in Apache2 not 1.3. I can use
mod_header. requestheader can add http header to request before mod_rewrite
pass it to zope. I can put REMOTE_USER in http header and zope will be able
to pick it up. User will still be able to bypass the check if they can use
special web browser which can add http header. But at least with standard IE
& Firefox, this method will be safe.
But I'm still using Apache 1.3. Above solution can't apply. :(
I'm giving up. Maybe just use some browser script to submit current username
to CredentialsPlugin.
This will be easy, just write my own version of
loginform.pt,
and that will work. But it's ugly.
Thanks,
Simon
On 11/13/05, Philipp von Weitershausen wrote:
>
> Florent Guillaume wrote:
> >> Well, Zope 3 doesn't care that Apache has authenticated your user. It
> >> doesn't see that. If you want the Zope 3 security system to interact
> >> with Apache's, here's a suggestion (not sure if it'll actually work):
> >>
> >> - Have Apache forward the REMOTE_USER CGI env variable, e.g. by using
> >> the "E" flag at the end of rewrite rule:
> >>
> >> [P,L,E=REMOTE_USER:%{REMOTE_USER}]
> >
> >
> > Will that really work? env variables are only useful in CGI mode, but
> > proxying doesn't involve CGI. Rather I'd advise using additional
> > parameters to the URL, like we do here for Zope 2 for instance:
> >
> > http://svn.nuxeo.org/trac/pub/file/CMFNtlmSso/trunk/doc/vhost_sso.conf
>
> Ah, yes. I thought of this initially but found the env way to be
> cleaner, simply assuming that mod_rewrite would pass the current env
> along on the proxy request. It seems it doesn't.
>
> Good example config, by the way.
>
> >> - Have a custom ICredentialsPlugin that's simply looks at this env
> >> variable in the request for the log-in credentials. To challenge the
> >> user for authentication, it would simply use the same authentication
> >> realm as set in the apache.conf, so that it gets picked up by Apache
> >> when the user provides the credentials.
> >
> >
> > And this plugin would have to get the credentials from the URL instead
> > of the env variable. I wish apache had a proper way to add request
> > headers during proxying...
>
> Yup and yup.
>
> Philipp
> _______________________________________________
> Zope3-users mailing list
> Zope3-users@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051113/593d9355/attachment.htm
From philipp at weitershausen.de Sun Nov 13 00:24:57 2005
From: philipp at weitershausen.de (Philipp von Weitershausen)
Date: Sun Nov 13 00:23:58 2005
Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM
In-Reply-To: <8a8e599a0511121548g3728ef4fl74a5833b5da428dc@mail.gmail.com>
References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com>
<4376425A.9050807@weitershausen.de>
<4376443B.7060809@nuxeo.com> <43764A25.10700@weitershausen.de>
<8a8e599a0511121548g3728ef4fl74a5833b5da428dc@mail.gmail.com>
Message-ID: <4376CE29.8060201@weitershausen.de>
Simon Hang wrote:
> Thanks for the help.
>
> I feel not comfortable to put the username in URL. User may be able to
> bypass the authentication and direct access zope with username in URL.
True, it's not the nicest solution. But you could make it safer by first
stripping the according request variable from the QUERY_STRING.
mod_rewrite is quite powerful in that respect.
> Now the only solution I found is only working in Apache2 not 1.3. I can
> use mod_header. requestheader can add http header to request before
> mod_rewrite pass it to zope. I can put REMOTE_USER in http header and
> zope will be able to pick it up. User will still be able to bypass the
> check if they can use special web browser which can add http header. But
> at least with standard IE & Firefox, this method will be safe.
Here you could strip any REMOTE_USER header or request variable from the
incoming request so that the REMOTE_USER that Zope sees is always the
one set by Apache, or none (even if the browser client tried to supply
its own one).
> But I'm still using Apache 1.3. Above solution can't apply. :(
Too bad, Apache 2.0 is quite nice.
Philipp
From Sven.Schomaker at Linie-M.de Mon Nov 14 02:55:15 2005
From: Sven.Schomaker at Linie-M.de (Sven Schomaker)
Date: Mon Nov 14 02:53:38 2005
Subject: [Zope3-Users] Maybe bug in pagetemplate parser?
Message-ID: <1131954915.6777.85.camel@localhost.localdomain>
Hi all,
currently I'm trying to output a pretty tiny code
snippet in a page template, but the compilation
fails due to a nesting error. It seems as if the
pt engine erroneously parses the following snippet,
complaining about a nesting error on the closing
div:
It also fails if I declare the whole script
content as XML CDATA section using
Message-ID: <200511141018231.SM01236@mobile02>
Hi Sven
> -----Original Message-----
> From: zope3-users-bounces@zope.org
> [mailto:zope3-users-bounces@zope.org] On Behalf Of Sven Schomaker
> Sent: Monday, November 14, 2005 8:55 AM
> To: zope3-dev; Zope3 users list
> Subject: [Zope3-Users] Maybe bug in pagetemplate parser?
>
> Hi all,
>
> currently I'm trying to output a pretty tiny code
> snippet in a page template, but the compilation
> fails due to a nesting error. It seems as if the
> pt engine erroneously parses the following snippet,
> complaining about a nesting error on the closing
> div:
>
>
>
>
> It also fails if I declare the whole script
> content as XML CDATA section using
> Is this is user error or a parser bug? Some
> help is very appreciated:-)
This is a bug, please add a issue to the bugtracker!
The parser engine tries to interprete the tag.
I guess the normal hacks used in onther script languages will
work. Try this:
> Greetings Sven
>
> _______________________________________________
> Zope3-users mailing list
> Zope3-users@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>
From jamesallwyn at gmail.com Mon Nov 14 05:03:35 2005
From: jamesallwyn at gmail.com (James Allwyn)
Date: Mon Nov 14 05:03:37 2005
Subject: [Zope3-Users] Complex Adapter Requirements - Named Adapters?
In-Reply-To: <200511120819.13727.srichter@cosmos.phy.tufts.edu>
References: <36d212000510301116v1f2ca3d3v@mail.gmail.com>
<200511120819.13727.srichter@cosmos.phy.tufts.edu>
Message-ID: <36d212000511140203s5e841636y@mail.gmail.com>
On 12/11/05, Stephan Richter
wrote:
> On Sunday 30 October 2005 14:16, James Allwyn wrote:
> > One thought I had, was creating an interface IStandard, with
> > attributes like "meetsstandard" and "nameofstandard", and then
> > subclass this, e.g. to IAccreditationScheme and INationalCode (where
> > "Accreditation Scheme" and "National Code" are the names of two of the
> > standards). But I get a little stuck conceptually at the point where I
> > try to handle, for example, the fact that for some ISharedHouse
> > objects, IAccreditationScheme would be suitable, whilst for others it
> > wouldn't, because of their location. In fact it's likely that in the
> > future we will need to recognise two or more standards for a
> > particular accommodation type (so IAccreditationScheme and IHouseCheck
> > chould both apply to ISharedHouse objects, in differect areas).
>
> This is not such a complex case as you think.
>
> If you register an adapter from ISharedHouse to IAccreditationScheme then it
> will be only available for this interface and not for IAccommodation in
> general. I would even write a specific IAccreditationScheme for every scheme
> you support; thus you do not even need named adapters.
OK, so by targeting the registration of the adapter I can make sure
each adapter is not available for types of accommodation object that
it would not apply to. I'm with you on that.
My thoughts about named adapters were related to the 'other side of
the coin', where I have more than one scheme (and hence adapter) that
would apply to one type of accommodation (for example the schemes
represented by IAccreditationScheme and IHouseCheck would both apply
to ISharedHouses). I guess what I want is to have both IHouseCheck and
IAccreditationScheme available for ISharedHouses *in general*, and to
select either (or none) for a given *instance* of ISharedHouse.
Are named adapters the way to go for this requirement, or am I not
understanding some mechanism in Stephan's suggestion that makes this
possible without invoking that level of complexity?
Thanks for the guidance so far.
James
From johanc at easypublisher.com Mon Nov 14 06:44:44 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Mon Nov 14 06:44:42 2005
Subject: [Zope3-Users] Getting the content object from a widget
Message-ID: <437878AC.9090703@easypublisher.com>
Hi,
I'm having trouble in finding a consistent way to locate
the content object from a widget (view) class.
(This is when using complex widgets like the ObjectWidget.)
Some background. I'm trying to implement a ImageField and a FileField
so I can add fields for Image and File objects to my schema.
After experimenting with the IObject field for a while I've
done the following things (I've only done the Image part, but
files should be a matter of cut&paste):
- Created an ImageField class (I basically just copied the Object
implementation)
- I've created an ImageWidget class (derived from ObjectWidget)
and registered it as a view for the ImageField.
- I've also added a custom IImage interface and Image implementation,
because I want to add fields to the IImage. (I'm guessing that I
"should" use annotations, but it's not gone happen in a long while,
this is consuming far too much of my time as it is.)
This works quite well (after endless fight with Z3 too understand how
the schema system works).
One of the hardest problem has been how to get information about my
Image object from the view.
In the ObjectWidget view the context is the field, the field in it's
turn as a context that is the content object.
So what I've done so far is just to climb up the context tree to
get to an object not defining a context (and that has been the content
object I'm after, but this strategy doesn't work when adding a content
object for instance, because there isn't a content object too be found.)
So I'm looking for a good generic way to find the content object (or
None if it doesn't exist).
Regards,
Johan
PS. I've also noticed that to be able to make web requests to the image
object I need to specify the __name__ attribute when setting up
the the field (just so that you know). Fields normaly lack the Location
interfaces so one needs to figure out the location manually.
Also fields need special traversers to be traversable from the web,
it's a consequence of the explicit nature of Z3 I guess.)
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From johanc at easypublisher.com Mon Nov 14 08:43:33 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Mon Nov 14 08:43:31 2005
Subject: [Fwd: Re: [Zope3-Users] Getting the content object from a widget]
Message-ID: <43789485.8070101@easypublisher.com>
-------- Original Message --------
Subject: Re: [Zope3-Users] Getting the content object from a widget
Date: Mon, 14 Nov 2005 14:14:02 +0100
From: Johan Carlsson
To: Johan Carlsson
References: <437878AC.9090703@easypublisher.com>
Johan Carlsson wrote:
Well, I extended the search loop to look like this:
def _getParent(self):
curr=self
while hasattr(curr, 'context') and \
(IField.providedBy(curr) or \
IInputWidget.providedBy(curr)):
curr=curr.context
return curr
Which means that it returnes the first non field non widget
it finds. It kind of does the trick.
One would have though I could just use:
def _getParent(self):
field=self.context
content=field.context
return content
But there is situations where a widget has a widget as it's context.
For instance the default ObjectWidget uses an ObjectWidgetView
as it's view class and when ObjectWidget sets it up it supplies
context=self (e.g. a widget as context).
I don't know why it's designed this way, in my ImageWidget, which
is based on ObjectWidget, I've cut out the ObjectWidgetView and
does every thing in the first view class. I did need to change
the page template to use view instead of context but othervice
it works ok (so far).
If anyones interested I can make the ImageField code available.
Regards,
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From jsmith030416 at yahoo.co.uk Mon Nov 14 16:00:04 2005
From: jsmith030416 at yahoo.co.uk (John Smith)
Date: Mon Nov 14 16:00:06 2005
Subject: [Zope3-Users] Renaming folder causes NotFoundError
Message-ID: <20051114210004.1503.qmail@web26511.mail.ukl.yahoo.com>
At the highest level of my content pages (ie the blue
pages in the zmi) i had a folder called 'myfolder'.
This folder contained my test objects ( the Car and
Journey example from my previous post). The data was
trivial and no loss to anyone. I'm still
experimenting.
Anyhow, I tried to rename the folder to something more
descriptive, and Zope3 keeps coming up with the "There
has been a system error" page, and on the terminal it
say s NotFoundError, 'myfolder'.
I have gone into the ZODB directly, and the
root['Application'] item contains the folder and its
contents, but with the new name 'MileageTracker'.
Firstly, I was a bit surprised that ZopeX3-3.0.0 did
this on a simple rename, although possibly it has
something to do with the contents of 'myfolder' which
where my own attempts at creating containers.
But now I'm intrigued because somewhere inside my ZODB
the system has remembered the old folder name even the
root['Application'] mapping object only seems to know
the object by its new name.
I have tried renaming the object back to its original
name, and committing the transaction, but that does
not work, an incremented integer seems to be added to
the name.
As I said, I'm not bothered about the data itself, it
is just that I would like to use Zope3 in a production
environment and I'd like to know how to recover from
this type of thing.
I've tried debugging the source by putting in print
statements and as best I can tell, the magic is
somewhere around line 604 in
zope.app.registration.registration.py where "Adapters"
is the supplied name and a serviceregistration object
is createed whose componentPath attributes is
'myfolder'. From where in the ZODB is it reading this
value!
Any help gratefully received,
John
___________________________________________________________
Yahoo! Model Search 2005 - Find the next catwalk superstars - http://uk.news.yahoo.com/hot/model-search/
From biggers at utsl.com Mon Nov 14 16:47:26 2005
From: biggers at utsl.com (Mark R. Biggers)
Date: Mon Nov 14 16:47:29 2005
Subject: [Zope3-Users] how to run "all tests" for Z3 svn-trunk (bundle)?
Message-ID: <17273.1518.441142.720283@dexter.saiph.com>
Hello,
I had to munge top-level 'test.py' to get it to work for the Z3.1
release 'tar.gz' bundle. It worked fine after that, and all the
unit-tests ran clean - impressive.
Now, as you can see below, from this build-recipe, that that's not
gonna cut it. I've nosed all about the Z3 svn-trunk dirs and files,
trying to get a handle on how to run all the Z3 svn-trunk tests.
If anyone has any ideas, that would be most helpful.
thank you,
----mark
--------------------------------
# Sun Nov 13 20:28:30 2005, Mon Nov 14 15:16:54 2005
ZSRC=/tools/zope/Zope3/Build
## there is no 3.2 release, yet...
ZVERS=Zope-3.2.0a1
ZINS=/usr/local/Zope/${ZVERS}
LOG=$ZSRC/${ZVERS}.log
py=/usr/bin/python2.4
cd $ZSRC
svn checkout svn://svn.zope.org/repos/main/Zope3/trunk Zope3_svn
cd Zope3_svn
svn co svn://svn.zope.org/repos/main/zpkgtools/trunk zpkgtools
cd releases
## zpkg attempts a SVN checkout, by rel-name...
## ../../zpkgtools/bin/zpkg -r Zope-3.2.0a1 -C Zope.cfg Zope
../zpkgtools/bin/zpkg -C Zope.cfg Zope
mv Zope-0.0.0.tgz $ZSRC
cd $ZSRC
mv -f $LOG $LOG.prev
/bin/rm -rf ${ZVERS}
tar zxf Zope-0.0.0.tgz
mv Zope-0.0.0 $ZVERS
cd $ZSRC/$ZVERS
# CONFIGURE: read if you want more details...
less README.txt
./configure --help
env OPT='-O3 -Wall -march=i686' \
./configure --prefix=$ZINS \
--force \
--with-python=$py \
>> $LOG 2>&1
# BUILD
make CFLAGS='-O3 -Wall -march=i686' >> $LOG 2>&1 &
# TEST - !! no go !! for Z3-trunk ...
make CFLAGS='-O3 -Wall -march=i686' test >> $LOG 2>&1 &
# cut 'n paste session of 'test.py' contents
amdahl:398 $ python2.4
Python 2.4.1 (#2, May 5 2005, 11:32:06)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, os
>>> from distutils.util import get_platform
>>> PLAT_SPEC = "%s-%s" % (get_platform(), sys.version[0:3])
>>> print PLAT_SPEC
linux-i686-2.4
>>> here = os.path.dirname(os.path.realpath(__file__))
Traceback (most recent call last):
File "", line 1, in ?
NameError: name '__file__' is not defined
>>> here = os.path.dirname(os.path.realpath('test.py'))
>>> print here
/mnt/hdc8/ZOPE/Zope-3.2.0a1
>>> lib = os.path.join(here, "build", "lib." + PLAT_SPEC)
>>> print lib
/mnt/hdc8/ZOPE/Zope-3.2.0a1/build/lib.linux-i686-2.4
>>> sys.path.append(lib)
>>> print sys.path
['', '/tools/python/dist-py', '/mnt/hdc8/ZOPE/Zope-3.2.0a1', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages', '/usr/lib/site-python', '/mnt/hdc8/ZOPE/Zope-3.2.0a1/build/lib.linux-i686-2.4', '/mnt/hdc8/ZOPE/Zope-3.2.0a1/build/lib.linux-i686-2.4']
>>> import zope.app.testing.test
Traceback (most recent call last):
File "", line 1, in ?
ImportError: No module named test
>
From chris at simplistix.co.uk Tue Nov 15 06:02:06 2005
From: chris at simplistix.co.uk (Chris Withers)
Date: Tue Nov 15 06:02:12 2005
Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM
In-Reply-To: <4376CE29.8060201@weitershausen.de>
References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> <4376425A.9050807@weitershausen.de> <4376443B.7060809@nuxeo.com>
<43764A25.10700@weitershausen.de> <8a8e599a0511121548g3728ef4fl74a5833b5da428dc@mail.gmail.com>
<4376CE29.8060201@weitershausen.de>
Message-ID: <4379C02E.7090201@simplistix.co.uk>
Philipp von Weitershausen wrote:
> True, it's not the nicest solution. But you could make it safer by first
> stripping the according request variable from the QUERY_STRING.
> mod_rewrite is quite powerful in that respect.
Is it just me, or should a deep feeling of uneasiness accompany the
extraction of authentication credentials from a query string? ;-)
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
From dman at dman13.dyndns.org Tue Nov 15 09:24:52 2005
From: dman at dman13.dyndns.org (Derrick Hudson)
Date: Tue Nov 15 09:24:51 2005
Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM
In-Reply-To: <4379C02E.7090201@simplistix.co.uk>
References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com>
<4376425A.9050807@weitershausen.de>
<4376443B.7060809@nuxeo.com> <43764A25.10700@weitershausen.de>
<8a8e599a0511121548g3728ef4fl74a5833b5da428dc@mail.gmail.com>
<4376CE29.8060201@weitershausen.de>
<4379C02E.7090201@simplistix.co.uk>
Message-ID: <20051115142452.GA27021@dman13.dyndns.org>
On Tue, Nov 15, 2005 at 11:02:06AM +0000, Chris Withers wrote:
| Philipp von Weitershausen wrote:
| >True, it's not the nicest solution. But you could make it safer by first
| >stripping the according request variable from the QUERY_STRING.
| >mod_rewrite is quite powerful in that respect.
|
| Is it just me, or should a deep feeling of uneasiness accompany the
| extraction of authentication credentials from a query string? ;-)
It's not just you. :-)
The hole this creates is: someone makes an HTTP request directly to
Zope bypassing apache altogether. This request could simply present
any username desired.
Some ways to limit the exposure of the hole is to have zope listen on
the loopback interface only. Then prevent all shell access on the
system. The only remaining hole at this point is if someone can
abuse some other network-accessible service and coerce it into making
the request (or to open a back door).
-D
--
Bugs come in through open windows. Keep Windows shut!
www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyndns.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051115/6209f07f/attachment.bin
From antonio.beamud at linkend.net Tue Nov 15 15:03:08 2005
From: antonio.beamud at linkend.net (Antonio Beamud Montero)
Date: Tue Nov 15 15:03:15 2005
Subject: [Zope3-Users] Validation of schemas?
In-Reply-To: <200511120737.11931.srichter@cosmos.phy.tufts.edu>
References:
<436A0C11.1060101@4js.com.au>
<200511120737.11931.srichter@cosmos.phy.tufts.edu>
Message-ID: <1132084989.4754.24.camel@homer.linkend.net>
El s?b, 12-11-2005 a las 07:37 -0500, Stephan Richter escribi?:
> On Thursday 03 November 2005 08:09, Adam Summers wrote:
> > This will do the validation on add. But how do I get the schema to be
> > validated on an
> > update to it?
>
> You could write your own property class that does the invariant checks. See
>
> zope.schema.fieldproperty.FieldProperty
>
> In fact, if you feel heroic, you should just add the invariance check to that
> code and check it in! That would be a great feature.!
If I define a field in a schema like:
groups = List(title=u'Groups',
default=[],
description=u'Groups of the contacts',
value_type=TextLine(title=u"Group"))
and in the class implementing this interface:
groups = FieldProperty(icontact.IContact['groups'])
The problem is how to define that groups is a PersistentList.
If I define the default schema as "default=PersistentList()" an error
happens...
ConfigurationError: ('Invalid value for', 'interface', "([], )")
Thanks.
From gnotari at linkgroup.it Wed Nov 16 06:31:37 2005
From: gnotari at linkgroup.it (gnotari@linkgroup.it)
Date: Wed Nov 16 06:29:01 2005
Subject: [Zope3-Users] Add menu
Message-ID:
We're redefining the container views in the project we're working at.
We have not yet redefined the skin (more on that in a later mail :), and
we're still using rotterdam.
We're a little at loss because the Add menu disappeared from the pages,
though, and we can't make out the logic behind its behaviour.
Can someone shed some light on the logic behing the display of this menu?
Ciao
Guido
From andreas at work.de Wed Nov 16 10:13:23 2005
From: andreas at work.de (Andreas Elvers)
Date: Wed Nov 16 10:21:08 2005
Subject: [Zope3-Users] Re: sqlos, sites and local utilities
In-Reply-To: <200511120805.22071.srichter@cosmos.phy.tufts.edu>
References:
<200511120805.22071.srichter@cosmos.phy.tufts.edu>
Message-ID:
Stephan Richter wrote:
> On Tuesday 08 November 2005 05:38, Andreas Elvers wrote:
[...]
>>Has anyone yet tried sqlos with database connections created as local
>>utilities ? At one point sqlos tries to get the utility in connection.py
>>Line 88.
>>
>> newconn = zapi.queryUtility(IZopeDatabaseAdapter, name,
>> default=None,
>> context=context)
>>
>>The context points to a sqlobject instance. The problem is that these
>>instances seem to have no parent and thus will fail the lookup my local
>>utility and will raise an 'NoneType' object is not callable error later
>>in the code when trying to adapt.
>>
>>When you try the sqlos example everything is fine, since the database
>>connection is defined in configure.zcml as a global utility.
>>
>>My current idea is to expose the enclosing folder as a context to query
>>utility. But I don't know if setting references in sqlobject instances
>>is such a great idea.
>
>
> If the sqlobject instance does not have a parent, then that's bad. It probably
> does not have a parent, because it is usually wrapped using a location proxy,
> which is lost inside a method. I think the smart thing to do here would be
> what you suggested or to write a subclass of sqlobject that implements
> ILocation.
Hi,
While digging a bit depper into my problem I found out, that
implementing ILocation
will not do the trick, since the mentioned exception is caused by a
factory call, and
a factory will never have a __parent__ or am I totally wrong here ?
Anyway I have created a functional unit test to demonstrate the problem.
In fact
the unit test shows that sqlos will always lookup global utilities and
never local utilities.
Here is the test. It will fail in the last block on
"testsite['personcontainer'] = personcontainer".
Regards
- Andreas
-------------- next part --------------
First we need to set up some folder structure to set up a site.
>>> from zope.app import zapi
>>> from zope.app.folder import Folder
>>> from zope.app.container.contained import Contained
>>> from sqlos.testing.sampleperson import SamplePersonContainer, createTestingTables
>>> from zope.app.component import interfaces as componentInterfaces
>>> from zope.app.component.site import LocalSiteManager,SiteManagerContainer
>>> from sqlos.container import SQLObjectContainer
>>> class LocalSitePersonContainer(SamplePersonContainer, SiteManagerContainer, Contained):
... pass
>>> root = getRootFolder()
>>> testsite = Folder()
>>> root['testsite'] = testsite
>>> componentInterfaces.ISite.providedBy(testsite)
False
>>> sm = LocalSiteManager(testsite)
>>> testsite.setSiteManager(sm)
>>> componentInterfaces.ISite.providedBy(testsite)
True
Now we set up a local database utility
>>> from zope.app.rdb.interfaces import IZopeDatabaseAdapter
>>> from zope.app.component.interfaces.registration import ActiveStatus,InactiveStatus
>>> from sqlos.testing.testdb import SQLiteda
>>> from zope.app.utility import UtilityRegistration
>>> dbAdapter = SQLiteda(u'dbi://:memory:')
>>> reg = UtilityRegistration('sqlite',IZopeDatabaseAdapter,dbAdapter)
>>> default = sm['default']
>>> key = default.registrationManager.addRegistration(reg)
>>> zapi.traverse(default.registrationManager, key).status = ActiveStatus
>>> localUtility = sm.queryUtility(IZopeDatabaseAdapter,'sqlite')
>>> localUtility
>>> localUtility is dbAdapter
True
Ok. Now we have a site in root/testsite with a registered sqlite adapter.
We make sure that our localUtility is not identical to the global sqlite utility
that has been registered through ftesting.zcml.
>>> gsm = zapi.getGlobalSiteManager()
>>> globalUtility = gsm.queryUtility(IZopeDatabaseAdapter,'sqlite')
>>> globalUtility is not localUtility
True
Now we populate testsite with data. We do this by using direct SQL, because there is currently
no support for local sites in testcode.
>>> from zope.component.interfaces import ISiteManager
>>> cursor = localUtility().cursor()
>>> cursor.execute(
... '''create table dog (
... id integer primary key,
... fullname varchar(50) not null,
... owner varchar(20) not null)''')
>>> cursor.execute(
... '''create table sample_isolated_person (
... id integer primary key,
... domains text,
... fullname varchar(50) not null,
... username varchar(20) not null,
... password varchar(20) not null)''')
>>> cursor.execute(
... '''create table sample_person (
... id integer primary key,
... fullname varchar(50),
... username varchar(20),
... password varchar(20))''')
Now that we have setup database tables we should be able to create the personcontainer without errors.
>>> personcontainer = LocalSitePersonContainer()
>>> testsite['personcontainer'] = personcontainer
>>> localUtility2 = ISiteManager(personcontainer).queryUtility(IZopeDatabaseAdapter,'sqlite')
>>> localUtility2 is localUtility
True
From eucci.group at gmail.com Wed Nov 16 15:38:37 2005
From: eucci.group at gmail.com (Jeff Shell)
Date: Wed Nov 16 16:07:48 2005
Subject: [Zope3-Users] Denying permissions for 'everybody' - which
principals to use?
Message-ID: <88d0d31b0511161238i6f34db7bhd571cc2077bad81c@mail.gmail.com>
For a simple content management system we're building, I've started
working on a simple security interface which is supposed to enable /
disable 'view' (and dublin core view). The setup that I have - or want
to have - is a UI that says:
Who can see this item?
- Everybody
- Nobody (grants view to zope.Manager and our.cms.ContentEditor roles
only, for now)
- Specific Users
If 'specific users' is selected, users from the local principal folder
are listed for selection.
I seem to have my implementation working somewhat - I can go to the
normal Grant screen and see specific users have 'Allow' checked for
the view permissions managed by my sharing view. And 'zope.anybody' is
denied:
>>> pprint(settingsForObject(jobs))
[(u'jobs',
{'principalPermissions': [{'permission': 'zope.View',
'principal': u'brcmscms.user2',
'setting': PermissionSetting: Allow},
{'permission': 'zope.View',
'principal': 'zope.anybody',
'setting': PermissionSetting: Deny},
{'permission': 'zope.app.dublincore.view',
'principal': u'brcmscms.user2',
'setting': PermissionSetting: Allow},
{'permission': 'zope.app.dublincore.view',
'principal': 'zope.anybody',
'setting': PermissionSetting: Deny}],
'principalRoles': [],
'rolePermissions': []}),
...
When I traverse to the object in question in another browser, I get
prompted for login. But if I supply different credentials (ie, one of
the users not Allowed explicit view privileges), I'll still see the
page.
Am I denying the right person here? Globally, the permission is set up
as follows:
{'permission': 'zope.View',
'role': 'zope.Anonymous',
'setting': PermissionSetting: Allow},
Should I Deny access to the zope.Anonymous role? To the Everybody
group? To the Unauthenticated Group? Right now, I only deny the
principal:
def denyUnauthenticated(self):
""" Explicitly deny the view permissions for unauthenticated users. """
anybody = zapi.getUtility(IUnauthenticatedPrincipal).id
pmanager = IPrincipalPermissionManager(self.context)
for permission in self._view_permissions:
pmanager.denyPermissionToPrincipal(permission, anybody)
This is in Zope 3.1.0 on Python 2.3.5
The point of this simple 'sharing' interface is to let our customer
have a press folder that they can restrict access to by allowing only
limited people in to it. We're trying to keep the user interface as
simple as possible.
From jsmith030416 at yahoo.co.uk Wed Nov 16 18:21:42 2005
From: jsmith030416 at yahoo.co.uk (John Smith)
Date: Wed Nov 16 18:21:44 2005
Subject: [Zope3-Users] Zope3 broke when renaming folder
Message-ID: <20051116232142.28802.qmail@web26509.mail.ukl.yahoo.com>
Dear Zope users,
Does anyone have a map as to where Zope3 stores its
data inside the ZODB?
the application data is in
.root()['Application'] and I can see my folders
there.
But what about the registration processes: is there
some mapping somewhere inside the ZODB that I can edit
to get my zope to restart?
What happened was I renamed a folder and zope3 had an
error. Renaming the folder to its previous value in
ZODB does not seem to have any effect, and the system
refuses to let me do anything: undo, delete etc. At
this point, my only option, is to delete Data.fs and
start again, but this seems a bit nuclear, for what
must surely be a bit of ZODB editing, if I but knew
where to look.
Thanks,
John
___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
From td at yoma.com.au Wed Nov 16 18:35:49 2005
From: td at yoma.com.au (Tom Dossis)
Date: Wed Nov 16 18:33:10 2005
Subject: [Zope3-Users] Zope3 broke when renaming folder
In-Reply-To: <20051116232142.28802.qmail@web26509.mail.ukl.yahoo.com>
References: <20051116232142.28802.qmail@web26509.mail.ukl.yahoo.com>
Message-ID: <437BC255.5050904@yoma.com.au>
John Smith wrote:
> Dear Zope users,
>
> Does anyone have a map as to where Zope3 stores its
> data inside the ZODB?
>
> the application data is in
> .root()['Application'] and I can see my folders
> there.
>
> But what about the registration processes: is there
> some mapping somewhere inside the ZODB that I can edit
> to get my zope to restart?
>
> What happened was I renamed a folder and zope3 had an
> error. Renaming the folder to its previous value in
> ZODB does not seem to have any effect, and the system
> refuses to let me do anything: undo, delete etc. At
> this point, my only option, is to delete Data.fs and
> start again, but this seems a bit nuclear, for what
> must surely be a bit of ZODB editing, if I but knew
> where to look.
Hi John,
You seem to be accessing the zodb directly.
Have you already tried via zope3?
Just in case you haven't look at 'Accessing objects (without the
debugger)' in doc/DEBUG.txt
From fg at nuxeo.com Wed Nov 16 20:38:39 2005
From: fg at nuxeo.com (Florent Guillaume)
Date: Wed Nov 16 20:38:42 2005
Subject: [Zope3-Users] Re: Zope3 broke when renaming folder
In-Reply-To: <20051116232142.28802.qmail@web26509.mail.ukl.yahoo.com>
References: <20051116232142.28802.qmail@web26509.mail.ukl.yahoo.com>
Message-ID: <437BDF1F.2050901@nuxeo.com>
John Smith wrote:
> Dear Zope users,
>
> Does anyone have a map as to where Zope3 stores its
> data inside the ZODB?
>
> the application data is in
> .root()['Application'] and I can see my folders
> there.
>
> But what about the registration processes: is there
> some mapping somewhere inside the ZODB that I can edit
> to get my zope to restart?
>
> What happened was I renamed a folder and zope3 had an
> error. Renaming the folder to its previous value in
> ZODB does not seem to have any effect, and the system
> refuses to let me do anything: undo, delete etc. At
> this point, my only option, is to delete Data.fs and
> start again, but this seems a bit nuclear, for what
> must surely be a bit of ZODB editing, if I but knew
> where to look.
We can't help you without the precise circumstances, the error and the
traceback.
Florent
--
Florent Guillaume, Nuxeo (Paris, France) Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
From fdrake at gmail.com Thu Nov 17 00:01:55 2005
From: fdrake at gmail.com (Fred Drake)
Date: Thu Nov 17 00:01:56 2005
Subject: [Zope3-dev] RE: [Zope3-Users] Maybe bug in pagetemplate parser?
In-Reply-To: <200511141018231.SM01236@mobile02>
References: <1131954915.6777.85.camel@localhost.localdomain>
<200511141018231.SM01236@mobile02>
Message-ID: <9cee7ab80511162101t6583d75ck3170e189b3bd50d3@mail.gmail.com>
On 11/14/05, Roger Ineichen wrote:
> This is a bug, please add a issue to the bugtracker!
> The parser engine tries to interprete the tag.
Though this is most certainly a contentious feature, this is not a bug
in the parser, but a bug in the template itself. The parser is a bit
stricter than most browsers. If you don't agree, please read the HTML
4.01 specification very carefully before following up; this has been
discussed to death many times.
> I guess the normal hacks used in onther script languages will
> work. Try this:
>
>
No, that won't work; the *template* still has the same bug. Try this:
(Note that the break introduced in the script source is between the
"<" and the next character.)
-Fred
--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
From johanc at easypublisher.com Thu Nov 17 06:52:55 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 06:52:52 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Message-ID: <437C6F17.4060300@easypublisher.com>
Anyone had any success with ZCatalog in Zope 3?
I'm trying to add indexes to the catalog
but I get an ComponentLookupError:
Error type: zope.component.interfaces.ComponentLookupError
Error object: (, '')
I'm not sure how to setup the IntIds utility, what I've done so far
is just add one and give it an random name.
Regards,
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From johanc at easypublisher.com Thu Nov 17 07:05:51 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 07:05:46 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437C6F17.4060300@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com>
Message-ID: <437C721F.30709@easypublisher.com>
Johan Carlsson wrote:
>
> Anyone had any success with ZCatalog in Zope 3?
>
> I'm trying to add indexes to the catalog
> but I get an ComponentLookupError:
>
> Error type: zope.component.interfaces.ComponentLookupError
> Error object: (, '')
>
> I'm not sure how to setup the IntIds utility, what I've done so far
> is just add one and give it an random name.
My bad, ComponentLookupError is what I get if I don't have setup an
IntIds utility, if I have set one up (currently mine is named IntIds
in the tools folder of the root site manager) I get:
Error type: zope.app.keyreference.interfaces.NotYet
Error object:
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From vladdrac at gmail.com Thu Nov 17 07:17:53 2005
From: vladdrac at gmail.com (Ivo van der Wijk)
Date: Thu Nov 17 07:17:54 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437C6F17.4060300@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com>
Message-ID:
On 11/17/05, Johan Carlsson wrote:
>
> Anyone had any success with ZCatalog in Zope 3?
>
> I'm trying to add indexes to the catalog
> but I get an ComponentLookupError:
>
> Error type: zope.component.interfaces.ComponentLookupError
> Error object: (, '')
>
> I'm not sure how to setup the IntIds utility, what I've done so far
> is just add one and give it an random name.
>
I managed to create a working Catalog/IntId setup in cubic, along with
actual indexing/searching (and a quick'n'dirty port of TextIndexNG3).
I can't remember details right now (been to long), but you could take
a peak at the code at
https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/
Specifically,
https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/cubicportal.py
and
https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/catalog/catalog.py
might give you some directions.
Regards,
Ivo
--
Drs. I.R. van der Wijk / m3r Consultancy B.V.
Linux/Python/Zope/Plone and Open Source solutions
PO-box 51091, 1007 EB Amsterdam, The Netherlands
Email: ivo m3r.nl
From j.kartnaller at robotech.at Thu Nov 17 07:14:27 2005
From: j.kartnaller at robotech.at (j.kartnaller)
Date: Thu Nov 17 07:18:56 2005
Subject: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437C721F.30709@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com>
<437C721F.30709@easypublisher.com>
Message-ID:
Johan Carlsson wrote:
> Johan Carlsson wrote:
>
>>
>> Anyone had any success with ZCatalog in Zope 3?
>>
>> I'm trying to add indexes to the catalog
>> but I get an ComponentLookupError:
>>
>> Error type: zope.component.interfaces.ComponentLookupError
>> Error object: (, '')
The IntId utility must not have an name as you see in the message.
Just rename your IntId utility and your up and running.
>>
>> I'm not sure how to setup the IntIds utility, what I've done so far
>> is just add one and give it an random name.
>
>
> My bad, ComponentLookupError is what I get if I don't have setup an
> IntIds utility, if I have set one up (currently mine is named IntIds
> in the tools folder of the root site manager) I get:
>
> Error type: zope.app.keyreference.interfaces.NotYet
> Error object:
>
>
J?rgen
From johanc at easypublisher.com Thu Nov 17 07:26:38 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 07:26:35 2005
Subject: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3?
In-Reply-To:
References: <437C6F17.4060300@easypublisher.com> <437C721F.30709@easypublisher.com>
Message-ID: <437C76FE.5020705@easypublisher.com>
j.kartnaller wrote:
> Johan Carlsson wrote:
>
>> Johan Carlsson wrote:
>>
>>>
>>> Anyone had any success with ZCatalog in Zope 3?
>>>
>>> I'm trying to add indexes to the catalog
>>> but I get an ComponentLookupError:
>>>
>>> Error type: zope.component.interfaces.ComponentLookupError
>>> Error object: (, '')
>
> The IntId utility must not have an name as you see in the message.
> Just rename your IntId utility and your up and running.
The name doesn't seem to have any importance (see my correction).
Also (afaik) it's not possible to add a object with an empty name
through the ZMI.
Thanks anyway,
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From johanc at easypublisher.com Thu Nov 17 07:28:10 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 07:28:06 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To:
References: <437C6F17.4060300@easypublisher.com>
Message-ID: <437C775A.6000500@easypublisher.com>
Ivo van der Wijk wrote:
> On 11/17/05, Johan Carlsson wrote:
>
>>Anyone had any success with ZCatalog in Zope 3?
>>
>>I'm trying to add indexes to the catalog
>>but I get an ComponentLookupError:
>>
>>Error type: zope.component.interfaces.ComponentLookupError
>>Error object: (, '')
>>
>>I'm not sure how to setup the IntIds utility, what I've done so far
>>is just add one and give it an random name.
>>
>
>
> I managed to create a working Catalog/IntId setup in cubic, along with
> actual indexing/searching (and a quick'n'dirty port of TextIndexNG3).
>
> I can't remember details right now (been to long), but you could take
> a peak at the code at
>
> https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/
>
> Specifically,
>
> https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/cubicportal.py
> and
> https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/catalog/catalog.py
>
> might give you some directions.
Excellent,
Probably exactly what I need :-)
I'll have a look.
Thanks,
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From johanc at easypublisher.com Thu Nov 17 07:32:05 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 07:32:04 2005
Subject: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3?
In-Reply-To:
References: <437C6F17.4060300@easypublisher.com> <437C721F.30709@easypublisher.com>
Message-ID: <437C7845.3080203@easypublisher.com>
j.kartnaller wrote:
> Johan Carlsson wrote:
>
>> Johan Carlsson wrote:
>>
>>>
>>> Anyone had any success with ZCatalog in Zope 3?
>>>
>>> I'm trying to add indexes to the catalog
>>> but I get an ComponentLookupError:
>>>
>>> Error type: zope.component.interfaces.ComponentLookupError
>>> Error object: (, '')
>
> The IntId utility must not have an name as you see in the message.
> Just rename your IntId utility and your up and running.
No I was infact quite worng, it is possible to change the ZMI, just
that one has too do it though the Site Manager not the contents view.
And it solves the problem too.
Thanks a bunch!
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From johanc at easypublisher.com Thu Nov 17 07:33:26 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 07:33:22 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To:
References: <437C6F17.4060300@easypublisher.com>
Message-ID: <437C7896.1060101@easypublisher.com>
Ivo van der Wijk wrote:
> On 11/17/05, Johan Carlsson wrote:
>
>>Anyone had any success with ZCatalog in Zope 3?
>>
>>I'm trying to add indexes to the catalog
>>but I get an ComponentLookupError:
>>
>>Error type: zope.component.interfaces.ComponentLookupError
>>Error object: (, '')
>>
>>I'm not sure how to setup the IntIds utility, what I've done so far
>>is just add one and give it an random name.
>>
>
>
> I managed to create a working Catalog/IntId setup in cubic, along with
> actual indexing/searching (and a quick'n'dirty port of TextIndexNG3).
>
> I can't remember details right now (been to long), but you could take
> a peak at the code at
>
> https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/
>
> Specifically,
>
> https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/cubicportal.py
> and
> https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/catalog/catalog.py
>
> might give you some directions.
The code you gave me shows the same showed the same problem as J?rgen
pointied out, the IntId needs to have '' as id.
Thanks,
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From johanc at easypublisher.com Thu Nov 17 07:34:12 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 07:34:08 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437C6F17.4060300@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com>
Message-ID: <437C78C4.4030406@easypublisher.com>
And thanks both of you for really fast replies :-)
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From vladdrac at gmail.com Thu Nov 17 07:37:28 2005
From: vladdrac at gmail.com (Ivo van der Wijk)
Date: Thu Nov 17 07:37:30 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437C7896.1060101@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com>
<437C7896.1060101@easypublisher.com>
Message-ID:
On 11/17/05, Johan Carlsson wrote:
>
> The code you gave me shows the same showed the same problem as J?rgen
> pointied out, the IntId needs to have '' as id.
I remember having some real issues with IntId / Catalog, I doubt if
they ever really got fixed. Check the patch in INSTALL.txt:
https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/INSTALL.txt
It once used to work for me, at least :)
--
Drs. I.R. van der Wijk / m3r Consultancy B.V.
Linux/Python/Zope/Plone and Open Source solutions
PO-box 51091, 1007 EB Amsterdam, The Netherlands
Email: ivo m3r.nl
From j.kartnaller at robotech.at Thu Nov 17 07:47:31 2005
From: j.kartnaller at robotech.at (j.kartnaller)
Date: Thu Nov 17 08:03:13 2005
Subject: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437C76FE.5020705@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com> <437C721F.30709@easypublisher.com>
<437C76FE.5020705@easypublisher.com>
Message-ID:
Johan Carlsson wrote:
> j.kartnaller wrote:
>
>> Johan Carlsson wrote:
>>
>>> Johan Carlsson wrote:
>>>
>>>>
>>>> Anyone had any success with ZCatalog in Zope 3?
>>>>
>>>> I'm trying to add indexes to the catalog
>>>> but I get an ComponentLookupError:
>>>>
>>>> Error type: zope.component.interfaces.ComponentLookupError
>>>> Error object: (, '')
>>
>>
>> The IntId utility must not have an name as you see in the message.
>> Just rename your IntId utility and your up and running.
>
>
> The name doesn't seem to have any importance (see my correction).
> Also (afaik) it's not possible to add a object with an empty name
> through the ZMI.
This is a know issue which was solved in the trunk and will be in 3.2.
Anyway you can rename after creating the utility.
J?rgen
From johanc at easypublisher.com Thu Nov 17 08:46:54 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 08:46:50 2005
Subject: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3?
In-Reply-To:
References: <437C6F17.4060300@easypublisher.com> <437C721F.30709@easypublisher.com> <437C76FE.5020705@easypublisher.com>
Message-ID: <437C89CE.4070204@easypublisher.com>
j.kartnaller wrote:
>> The name doesn't seem to have any importance (see my correction).
>> Also (afaik) it's not possible to add a object with an empty name
>> through the ZMI.
>
>
> This is a know issue which was solved in the trunk and will be in 3.2.
>
> Anyway you can rename after creating the utility.
Yeah, I noticed that after my first responce.
Thanks again,
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From johanc at easypublisher.com Thu Nov 17 08:47:32 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 08:47:32 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To:
References: <437C6F17.4060300@easypublisher.com>
<437C7896.1060101@easypublisher.com>
Message-ID: <437C89F4.3090101@easypublisher.com>
Ivo van der Wijk wrote:
> On 11/17/05, Johan Carlsson wrote:
>
>
>>The code you gave me shows the same showed the same problem as J?rgen
>>pointied out, the IntId needs to have '' as id.
>
>
> I remember having some real issues with IntId / Catalog, I doubt if
> they ever really got fixed. Check the patch in INSTALL.txt:
>
> https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/INSTALL.txt
>
> It once used to work for me, at least :)
Ah, thanks for the heads up.
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From johanc at easypublisher.com Thu Nov 17 09:05:41 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 09:05:37 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437C89F4.3090101@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com>
<437C89F4.3090101@easypublisher.com>
Message-ID: <437C8E35.5090002@easypublisher.com>
Johan Carlsson wrote:
> Ivo van der Wijk wrote:
>
>> On 11/17/05, Johan Carlsson wrote:
>>
>>
>>> The code you gave me shows the same showed the same problem as J?rgen
>>> pointied out, the IntId needs to have '' as id.
>>
>>
>>
>> I remember having some real issues with IntId / Catalog, I doubt if
>> they ever really got fixed. Check the patch in INSTALL.txt:
>>
>> https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/INSTALL.txt
>>
>> It once used to work for me, at least :)
>
> Ah, thanks for the heads up.
Now I see, that's exactly what been bitting my butt all along.
The patch fixes the problem!
Thanks again,
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From gary at zope.com Thu Nov 17 09:28:24 2005
From: gary at zope.com (Gary Poster)
Date: Thu Nov 17 09:28:28 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437C8E35.5090002@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com>
<437C89F4.3090101@easypublisher.com>
<437C8E35.5090002@easypublisher.com>
Message-ID: <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com>
On Nov 17, 2005, at 9:05 AM, Johan Carlsson wrote:
> Johan Carlsson wrote:
>> Ivo van der Wijk wrote:
>>> On 11/17/05, Johan Carlsson wrote:
>>>
>>>
>>>> The code you gave me shows the same showed the same problem as
>>>> J?rgen
>>>> pointied out, the IntId needs to have '' as id.
>>>
>>>
>>>
>>> I remember having some real issues with IntId / Catalog, I doubt if
>>> they ever really got fixed. Check the patch in INSTALL.txt:
>>>
>>> https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/
>>> INSTALL.txt
>>>
>>> It once used to work for me, at least :)
>> Ah, thanks for the heads up.
>
> Now I see, that's exactly what been bitting my butt all along.
>
> The patch fixes the problem!
Hm. A very quick look at the patch concerns me a bit. Am I right
that, if you apply the patch, then requests that are currently
raising a NotYet for you will instead silently fail, not cataloging
what you requested? That seems undesirable to me. I'd prefer the
exception.
If I'm on the right track here, then the extentcatalog in the
zc.catalog package in the sandbox probably is one of possibly many
other better solutions than the patch. It postpones cataloging to
the end of the transaction, which I believe will remove the NotYet
exceptions *and* successfully catalog your data.
Apologies if my quick patch read is off base.
Gary
From johanc at easypublisher.com Thu Nov 17 10:11:49 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 10:11:47 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com>
References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com>
<437C89F4.3090101@easypublisher.com>
<437C8E35.5090002@easypublisher.com>
<0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com>
Message-ID: <437C9DB5.50005@easypublisher.com>
Gary Poster wrote:
>
> Hm. A very quick look at the patch concerns me a bit. Am I right
> that, if you apply the patch, then requests that are currently raising
> a NotYet for you will instead silently fail, not cataloging what you
> requested? That seems undesirable to me. I'd prefer the exception.
>
> If I'm on the right track here, then the extentcatalog in the
> zc.catalog package in the sandbox probably is one of possibly many
> other better solutions than the patch. It postpones cataloging to the
> end of the transaction, which I believe will remove the NotYet
> exceptions *and* successfully catalog your data.
In my case I'm not interested in cataloging anything, there reason is
I'm just adding new fields to a newly created catalog and there
aren't any object to catalog just yet.
I'm guessing Ivo has similare problems because he also are creating
the catalog programmetically.
I'm doing this as a part of a custom add view that defines a
overrided createAndAdd(self, data), I think Ivo does it
in a more CMF like fashion (just after quick glans on his code).
I don't have the faintest idea what NotYet is supposted to be
raise for? Accutally I'm haveing problems finding the code
that does this because the traceback is Zope 3 cryptic and
I don't have a debugger setup either.
(I was hoping not having to care about the innerworks of the catalog,
but that maybe is too much too hope for ;-)
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From dominik.huber at perse.ch Thu Nov 17 10:49:38 2005
From: dominik.huber at perse.ch (Dominik Huber)
Date: Thu Nov 17 10:49:47 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437C9DB5.50005@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com>
<437C9DB5.50005@easypublisher.com>
Message-ID: <437CA692.6040400@perse.ch>
Hi Johan
Your problem is that the catalog is not locatable itself during the
addition of its indexes (-> state within the create and add method),
therefore the location of the indexes cannot be located and the
NotYetError is raised. You can move your code to an
ObjectAddedEvent-subscriber for your object.
handler pseudo code:
def addCatalogAndIndex(obj, event):
sm = zapi.getNextSiteManager(obj)
catalog = Catalog()
addLocalUtility(sm, 'XY', ICatalog, catalog)
catalog[name] = Index(name, IAnyInterface)
Regards,
Dominik
Johan Carlsson wrote:
> Gary Poster wrote:
>
>>
>> Hm. A very quick look at the patch concerns me a bit. Am I right
>> that, if you apply the patch, then requests that are currently
>> raising a NotYet for you will instead silently fail, not cataloging
>> what you requested? That seems undesirable to me. I'd prefer the
>> exception.
>>
>> If I'm on the right track here, then the extentcatalog in the
>> zc.catalog package in the sandbox probably is one of possibly many
>> other better solutions than the patch. It postpones cataloging to
>> the end of the transaction, which I believe will remove the NotYet
>> exceptions *and* successfully catalog your data.
>
>
> In my case I'm not interested in cataloging anything, there reason is
> I'm just adding new fields to a newly created catalog and there
> aren't any object to catalog just yet.
>
> I'm guessing Ivo has similare problems because he also are creating
> the catalog programmetically.
>
> I'm doing this as a part of a custom add view that defines a
> overrided createAndAdd(self, data), I think Ivo does it
> in a more CMF like fashion (just after quick glans on his code).
>
> I don't have the faintest idea what NotYet is supposted to be
> raise for? Accutally I'm haveing problems finding the code
> that does this because the traceback is Zope 3 cryptic and
> I don't have a debugger setup either.
>
> (I was hoping not having to care about the innerworks of the catalog,
> but that maybe is too much too hope for ;-)
>
> Johan
>
>
>
>
>
--
Dominik Huber
Perse Engineering GmbH
Jurastrasse 9a
CH-5406 Baden
E-Mail: dominik.huber@perse.ch
Telefon: ++41 56 534 7730
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dominik.huber.vcf
Type: text/x-vcard
Size: 154 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051117/6b6c340d/dominik.huber.vcf
From johanc at easypublisher.com Thu Nov 17 10:54:06 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 10:54:03 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437CA692.6040400@perse.ch>
References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com>
<437C9DB5.50005@easypublisher.com> <437CA692.6040400@perse.ch>
Message-ID: <437CA79E.9000108@easypublisher.com>
Dominik Huber wrote:
> Hi Johan
> Your problem is that the catalog is not locatable itself during the
> addition of its indexes (-> state within the create and add method),
> therefore the location of the indexes cannot be located and the
> NotYetError is raised. You can move your code to an
> ObjectAddedEvent-subscriber for your object.
>
> for=".IYourObject zope.app.container.interfaces.IObjectAddedEvent"
> handler=".addCatalogAndIndex"
> />
>
> handler pseudo code:
>
> def addCatalogAndIndex(obj, event):
> sm = zapi.getNextSiteManager(obj)
> catalog = Catalog()
> addLocalUtility(sm, 'XY', ICatalog, catalog)
> catalog[name] = Index(name, IAnyInterface)
Ok, that's by the way how Ivo does it (I've just read).
Thanks,
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From johanc at easypublisher.com Thu Nov 17 11:26:01 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 11:25:57 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437CA692.6040400@perse.ch>
References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com>
<437C9DB5.50005@easypublisher.com> <437CA692.6040400@perse.ch>
Message-ID: <437CAF19.1070707@easypublisher.com>
Dominik Huber wrote:
> Hi Johan
> Your problem is that the catalog is not locatable itself during the
> addition of its indexes (-> state within the create and add method),
> therefore the location of the indexes cannot be located and the
> NotYetError is raised. You can move your code to an
> ObjectAddedEvent-subscriber for your object.
>
> for=".IYourObject zope.app.container.interfaces.IObjectAddedEvent"
> handler=".addCatalogAndIndex"
> />
>
> handler pseudo code:
>
> def addCatalogAndIndex(obj, event):
> sm = zapi.getNextSiteManager(obj)
> catalog = Catalog()
> addLocalUtility(sm, 'XY', ICatalog, catalog)
> catalog[name] = Index(name, IAnyInterface)
I've tried this, it doesn't remove the NotYet problem though!??
Regards,
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From dominik.huber at perse.ch Thu Nov 17 11:32:29 2005
From: dominik.huber at perse.ch (Dominik Huber)
Date: Thu Nov 17 11:32:35 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437CAF19.1070707@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com>
<437C9DB5.50005@easypublisher.com> <437CA692.6040400@perse.ch>
<437CAF19.1070707@easypublisher.com>
Message-ID: <437CB09D.4010407@perse.ch>
Johan Carlsson wrote:
> Dominik Huber wrote:
>
>> Hi Johan
>> Your problem is that the catalog is not locatable itself during the
>> addition of its indexes (-> state within the create and add method),
>> therefore the location of the indexes cannot be located and the
>> NotYetError is raised. You can move your code to an
>> ObjectAddedEvent-subscriber for your object.
>>
>> > for=".IYourObject zope.app.container.interfaces.IObjectAddedEvent"
>> handler=".addCatalogAndIndex"
>> />
>>
>> handler pseudo code:
>>
>> def addCatalogAndIndex(obj, event):
>> sm = zapi.getNextSiteManager(obj)
>> catalog = Catalog()
>> addLocalUtility(sm, 'XY', ICatalog, catalog)
>> catalog[name] = Index(name, IAnyInterface)
>
>
> I've tried this, it doesn't remove the NotYet problem though!??
Our framework relies on that concept and it is still working ;)
Did you assert to add the catalog to the sitemanagement folder before
adding its indexes?
Dominik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dominik.huber.vcf
Type: text/x-vcard
Size: 154 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051117/fc43f1ef/dominik.huber.vcf
From johanc at easypublisher.com Thu Nov 17 12:12:32 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Thu Nov 17 12:12:29 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437CB09D.4010407@perse.ch>
References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com>
<437C9DB5.50005@easypublisher.com> <437CA692.6040400@perse.ch>
<437CAF19.1070707@easypublisher.com> <437CB09D.4010407@perse.ch>
Message-ID: <437CBA00.1060102@easypublisher.com>
Dominik Huber wrote:
> Johan Carlsson wrote:
>> I've tried this, it doesn't remove the NotYet problem though!??
>
>
> Our framework relies on that concept and it is still working ;)
> Did you assert to add the catalog to the sitemanagement folder before
> adding its indexes?
I found the error, in the AddView I had to remove the security context
to be able to setup things, I don't need that in the event handler.
The removed security context appears to have been the reason for the
NotYet problems.
Thanks for kicking me in the right direction :-)
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From td at yoma.com.au Thu Nov 17 17:26:13 2005
From: td at yoma.com.au (Tom Dossis)
Date: Thu Nov 17 17:23:29 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437CA692.6040400@perse.ch>
References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> <437C9DB5.50005@easypublisher.com>
<437CA692.6040400@perse.ch>
Message-ID: <437D0385.1010505@yoma.com.au>
Dominik Huber wrote:
>
> for=".IYourObject zope.app.container.interfaces.IObjectAddedEvent"
> handler=".addCatalogAndIndex"
> />
>
> handler pseudo code:
>
> def addCatalogAndIndex(obj, event):
> sm = zapi.getNextSiteManager(obj)
> catalog = Catalog()
> addLocalUtility(sm, 'XY', ICatalog, catalog)
> catalog[name] = Index(name, IAnyInterface)
>
> Regards,
> Dominik
From the apidoc for IWriteContainer.__setitem__(name, object)
it states..
''If an add event is generated and the object can be adapted to
IObjectAddedEvent, then the adapter's addNotify method is called with
the event.''
This could be alternative way to implement the the subscriber solution
above. However, from looking at the code (Zope3.1) it doesn't seem to
to what the apidoc claims.
Does anybody know if this is still intended?
-Tom
From johanc at easypublisher.com Fri Nov 18 05:58:20 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Fri Nov 18 05:58:16 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437C6F17.4060300@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com>
Message-ID: <437DB3CC.1090101@easypublisher.com>
Hi again,
The ComponentLookupError have re appeared!
> Error type: zope.component.interfaces.ComponentLookupError
> Error object: (, '')
What happend was that I had a IntId utitlity in the root site (renamed
to '') that answered the request when I added the Indexes in a sub site.
So the question is how do I rename the IntId utility programmatically
or why doesn't the following code ad a utility (maybe it's not
registered correctly to be use right after it's been added but needs
some events to trigger first???
First I do this:
intids = IntIds()
tools['intid'] = intids
#I thought this was equal to rename the intid-util to ''!?
intids_reg = UtilityRegistration('', IIntIds, intids)
rm.addRegistration(intids_reg)
intids_reg.status = ActiveStatus
Right after that I do this:
catalog = Catalog()
for index_name, index_attribute, idx_if, attr_call, index_type
in indexes:
idx = index_type(index_attribute, idx_if, attr_call)
catalog[index_name] = idx
tools['catalog'] = catalog
catalog_reg = UtilityRegistration('catalog', ICatalog, catalog)
rm.addRegistration(catalog_reg)
catalog_reg.status = ActiveStatus
This is all called from an event handler, like Dominik pointed out I
should do it.
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From johanc at easypublisher.com Fri Nov 18 06:02:57 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Fri Nov 18 06:02:55 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437DB3CC.1090101@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com>
<437DB3CC.1090101@easypublisher.com>
Message-ID: <437DB4E1.5010603@easypublisher.com>
Johan Carlsson wrote:
> Hi again,
>
> The ComponentLookupError have re appeared!
>
> > Error type: zope.component.interfaces.ComponentLookupError
> > Error object: (, '')
>
> What happend was that I had a IntId utitlity in the root site (renamed
> to '') that answered the request when I added the Indexes in a sub site.
>
> So the question is how do I rename the IntId utility programmatically
> or why doesn't the following code ad a utility (maybe it's not
> registered correctly to be use right after it's been added but needs
> some events to trigger first???
So, with som testing I figured out that the name is set to ''
but it doesn't get accessible right away:
zapi.getAllUtilitiesRegisteredFor(IIntIds) returns an empty tuple.
Is there some kind of flush-call or commit-call that needs to be executed?
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From johanc at easypublisher.com Fri Nov 18 06:22:18 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Fri Nov 18 06:22:14 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437CBA00.1060102@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> <437C9DB5.50005@easypublisher.com>
<437CA692.6040400@perse.ch> <437CAF19.1070707@easypublisher.com>
<437CB09D.4010407@perse.ch> <437CBA00.1060102@easypublisher.com>
Message-ID: <437DB96A.9060203@easypublisher.com>
Johan Carlsson wrote:
> Dominik Huber wrote:
>
>> Johan Carlsson wrote:
>
>>> I've tried this, it doesn't remove the NotYet problem though!??
>>
>> Our framework relies on that concept and it is still working ;)
>> Did you assert to add the catalog to the sitemanagement folder before
>> adding its indexes?
>
> I found the error, in the AddView I had to remove the security context
> to be able to setup things, I don't need that in the event handler.
> The removed security context appears to have been the reason for the
> NotYet problems.
>
> Thanks for kicking me in the right direction :-)
Looks like I was wrong on the NotYet too.
It doesn't work in a event handler either :-(
Ivos patch is still the only thing that works.
/Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From eucci.group at gmail.com Fri Nov 18 13:24:05 2005
From: eucci.group at gmail.com (Jeff Shell)
Date: Fri Nov 18 13:30:07 2005
Subject: [Zope3-Users] Generations - a missed use case? (Evolving an
application for the first time)
Message-ID: <88d0d31b0511181024g79258187u93ed29ff1448af40@mail.gmail.com>
I have an application where I'm trying to use 'zope.app.generations'
for the first time. And after much pulling of hair and looking at the
core code, I found what may be a missed scenario.
Basically, we deployed this application for a customer and now they
want some changes. It changes the schema of one item to store values
in tuples instead of strings. I wrote an evolve module, 'evolve1.py'
in myapp.generations, made the schema manager, registered it as a
utility, bla bla bla. But my code seemed like it would never run.
I'd run the debuzope script and look at the database
root['zope.app.generations'], and there was 'myapp' with the value of
1. I'd keep deleting that key and committing the transaction, but my
code would still never run. I tried running it manually using
pdb.run() to step through it and make sure that it was finding the
right objects and doing its job. My code was fine. So I looked at the
code in zope.app.generations.generations and found this interesting
tidbit:
for key, manager in findManagers():
generation = generations.get(key)
if generation == manager.generation:
continue
if generation is None:
# This is a new database, so no old data
if IInstallableSchemaManager.providedBy(manager):
try:
manager.install(context)
except:
transaction.abort()
logging.getLogger('zope.app.generations').exception(
"Failed to install %s",
key)
raise
generations[key] = manager.generation
transaction.commit()
continue
(the code continues from there
There's one problem here - in my situation, it's NOT A NEW DATABASE.
There is old data that needs to be evolved, but there's no record of a
generation for this application because there was no need for a schema
manager until now.
I really like the concept and general implementation of the schema
manager, but this scenario is driving me crazy. I could write an
'install' script, but that doesn't really cover this situation. After
install is run, the database marks the application generation. This
makes sense for new applications installing themselves - there's no
old data to update, so if the application is at generation 5, for
example, it doesn't need to be evolved to '5' if all of the data
that's installed or used is already in generation 5 form. (ie - if I
were deploying my application fresh today, my fields would already be
tuples instead of strings).
But my situation, where I already have a deployed application, is not
covered by this. I *could* write an 'install' script for the schema
manager that did this first evolution that I need to do. But then that
installer would have to be updated with all of the future evolutions
as well - since in theory, I could update an application from before
the schema manager and need to bring it up to generation 5 or 8 from
essentially 0.
It seems like the Schema Manager needs an 'evolve from 0' option, with
'0' being set by the evolution script of no previous evolution was
found but (somehow) existing data could be detected. The other
solutions seem to be:
* Write an install script that then manually calls all of the evolvers
to bring things up to the current generation.
* Always put a schema manager in your application, with the starting
generation of 0, so that you can upgrade in the future.
Neither option seems quite tenable - like a bad hack that goes against
the Zope 3 concepts. You shouldn't need a schema manager utility until
you need it, and having a script that manually does
'evolve1.evolve(context); evolve2.evolve(context)'... seems like it
goes against the sort of problem that the generations system is trying
to solve.
Is there something about the schema manager/generations system that I missed?
From marc at rijken.org Sun Nov 20 09:07:02 2005
From: marc at rijken.org (Marc Rijken)
Date: Sun Nov 20 09:07:01 2005
Subject: [Zope3-Users] Skin traversing error
In-Reply-To: <200509062321.50572.srichter@cosmos.phy.tufts.edu>
References: <1126051263.14377.8.camel@localhost.localdomain>
<200509062321.50572.srichter@cosmos.phy.tufts.edu>
Message-ID: <43808306.6040706@rijken.org>
Hi all,
I have a site with his own skin. In the skin there are some resources. When I try
to get the resource via localhost/@@/logo.gif I get the logo. When I try get
the resource via localhost/site/@@/logo.gif I get a NotFound error. What can be
the cause of this? It has something to do with the site "site" in my
Zope3-instance. Who can help me?
Best regards,
Marc
From jim at zope.com Sun Nov 20 10:31:48 2005
From: jim at zope.com (Jim Fulton)
Date: Sun Nov 20 10:31:50 2005
Subject: [Zope3-Users] Generations - a missed use case? (Evolving
an application for the first time)
In-Reply-To: <88d0d31b0511181024g79258187u93ed29ff1448af40@mail.gmail.com>
References: <88d0d31b0511181024g79258187u93ed29ff1448af40@mail.gmail.com>
Message-ID: <438096E4.1050000@zope.com>
Jeff Shell wrote:
> I have an application where I'm trying to use 'zope.app.generations'
> for the first time. And after much pulling of hair and looking at the
> core code, I found what may be a missed scenario.
>
> Basically, we deployed this application for a customer and now they
> want some changes. It changes the schema of one item to store values
> in tuples instead of strings. I wrote an evolve module, 'evolve1.py'
> in myapp.generations, made the schema manager, registered it as a
> utility, bla bla bla. But my code seemed like it would never run.
>
> I'd run the debuzope script and look at the database
> root['zope.app.generations'], and there was 'myapp' with the value of
> 1. I'd keep deleting that key and committing the transaction, but my
> code would still never run. I tried running it manually using
> pdb.run() to step through it and make sure that it was finding the
> right objects and doing its job. My code was fine. So I looked at the
> code in zope.app.generations.generations and found this interesting
> tidbit:
>
> for key, manager in findManagers():
> generation = generations.get(key)
>
> if generation == manager.generation:
> continue
>
> if generation is None:
> # This is a new database, so no old data
>
> if IInstallableSchemaManager.providedBy(manager):
> try:
> manager.install(context)
> except:
> transaction.abort()
> logging.getLogger('zope.app.generations').exception(
> "Failed to install %s",
> key)
> raise
>
> generations[key] = manager.generation
> transaction.commit()
> continue
>
> (the code continues from there
>
> There's one problem here - in my situation, it's NOT A NEW DATABASE.
> There is old data that needs to be evolved, but there's no record of a
> generation for this application because there was no need for a schema
> manager until now.
>
> I really like the concept and general implementation of the schema
> manager, but this scenario is driving me crazy. I could write an
> 'install' script, but that doesn't really cover this situation. After
> install is run, the database marks the application generation. This
> makes sense for new applications installing themselves - there's no
> old data to update, so if the application is at generation 5, for
> example, it doesn't need to be evolved to '5' if all of the data
> that's installed or used is already in generation 5 form. (ie - if I
> were deploying my application fresh today, my fields would already be
> tuples instead of strings).
>
> But my situation, where I already have a deployed application, is not
> covered by this. I *could* write an 'install' script for the schema
> manager that did this first evolution that I need to do. But then that
> installer would have to be updated with all of the future evolutions
> as well - since in theory, I could update an application from before
> the schema manager and need to bring it up to generation 5 or 8 from
> essentially 0.
Note that a common strategy for install scripts is to run evolution
scripts. This is fairly straightforward.
The assumption of the generations system was that you would use it
from the start. You make a good point though that many people won't
pay attention to the generations system until they need it, which, as things
are, is too late.
> It seems like the Schema Manager needs an 'evolve from 0' option, with
> '0' being set by the evolution script of no previous evolution was
> found but (somehow) existing data could be detected. The other
> solutions seem to be:
>
> * Write an install script that then manually calls all of the evolvers
> to bring things up to the current generation.
> * Always put a schema manager in your application, with the starting
> generation of 0, so that you can upgrade in the future.
>
> Neither option seems quite tenable - like a bad hack that goes against
> the Zope 3 concepts. You shouldn't need a schema manager utility until
> you need it,
Fron a practical perspective, I agree.
> and having a script that manually does
> 'evolve1.evolve(context); evolve2.evolve(context)'... seems like it
> goes against the sort of problem that the generations system is trying
> to solve.
I don't really see why. See below.
> Is there something about the schema manager/generations system that I missed?
Only this: I don't want to saddle developers with supporting all
old versions of their products. In many cases, this could represent a
very significant burden.
There are really 2 related cases: install and catchup. Install
is meant for situations in which an application hasn't been used
before, while catchup is for apps that need to get around not providing
generation support in the past. Unfortunately, there's no way for the
generation system to know which situation applies. Presumably, an install
script can have the logic to know this and perform some appropriate
action. Note too that an application that needs to catch up from
an "unmanaged" generation to a current generation might prefer to
provide a direct conversion, rather than taking intermediate steps.
Assuming that the best way to catch up is by running all evolution scripts
from (before) the beggining is guessing too much.
In summary, I think that the installation script is the right way to
handle this situation.
Jim
--
Jim Fulton mailto:jim@zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
From mailinglists at xgm.de Sun Nov 20 16:57:03 2005
From: mailinglists at xgm.de (Florian Lindner)
Date: Sun Nov 20 16:57:03 2005
Subject: [Zope3-Users] PAU and Session Credentials
Message-ID: <200511202257.03402.mailinglists@xgm.de>
Hello,
I've created and registered a PluggableAuthentication in my site. I've added
two plugins: PrincipalFolder and SessionCredentialsPlugin and registered
both. I've configured the PAU to use these plugins. In the principal folder
I've created a Principal. I've also created a loginForm.html that looks like
that:
If I try to call a page which reguired a specific permission the loginForm
comes up. But when I enter the login and password of the Principal in the
Principal Folder or a the manager principal defined on creation of the
instance I just get redirected to the login page again. This now was the
behavior before a played around with the PAU a bit now it has changed to a
system error:
TraversalError: (Principal(u'pre1'), 'getLogin')
The error log information of the user:
User: unauthenticated, pre1, CS.User,
pre is the prefix of my principal folder (BTW: what is the sense of this
prefix), 1 is the object id of my test principal, CS.User the role of the
principal.
I've been stepping in the session credentials plugin code and I see that the
login and password date is extracted correctly.
Somehow I'm still confused how everything is supposed to work...
Thanks,
Florian
From dominik.huber at perse.ch Mon Nov 21 09:17:26 2005
From: dominik.huber at perse.ch (Dominik Huber)
Date: Mon Nov 21 09:17:37 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437DB3CC.1090101@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com>
<437DB3CC.1090101@easypublisher.com>
Message-ID: <4381D6F6.7090000@perse.ch>
Johan Carlsson wrote:
> ....
>
>
> Right after that I do this:
>
>
> catalog = Catalog()
> for index_name, index_attribute, idx_if, attr_call, index_type
> in indexes:
> idx = index_type(index_attribute, idx_if, attr_call)
> catalog[index_name] = idx
> tools['catalog'] = catalog
> catalog_reg = UtilityRegistration('catalog', ICatalog, catalog)
> rm.addRegistration(catalog_reg)
> catalog_reg.status = ActiveStatus
change the order and it will work:
catalog = Catalog()
tools['catalog'] = catalog
catalog_reg = UtilityRegistration('catalog', ICatalog, catalog)
rm.addRegistration(catalog_reg)
catalog_reg.status = ActiveStatus
# add the indexes after the catalog is set to the tools
for index_name, index_attribute, idx_if, attr_call, index_type
in indexes:
idx = index_type(index_attribute, idx_if, attr_call)
catalog[index_name] = idx
regards,
Dominik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dominik.huber.vcf
Type: text/x-vcard
Size: 154 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051121/f953afc6/dominik.huber.vcf
From johanc at easypublisher.com Mon Nov 21 09:38:43 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Mon Nov 21 09:38:46 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <4381D6F6.7090000@perse.ch>
References: <437C6F17.4060300@easypublisher.com>
<437DB3CC.1090101@easypublisher.com> <4381D6F6.7090000@perse.ch>
Message-ID: <4381DBF3.9010102@easypublisher.com>
Dominik Huber wrote:
> Johan Carlsson wrote:
>
>> ....
>>
>>
>> Right after that I do this:
>>
>>
>> catalog = Catalog()
>> for index_name, index_attribute, idx_if, attr_call, index_type
>> in indexes:
>> idx = index_type(index_attribute, idx_if, attr_call)
>> catalog[index_name] = idx
>> tools['catalog'] = catalog
>> catalog_reg = UtilityRegistration('catalog', ICatalog, catalog)
>> rm.addRegistration(catalog_reg)
>> catalog_reg.status = ActiveStatus
>
>
> change the order and it will work:
>
> catalog = Catalog()
> tools['catalog'] = catalog
> catalog_reg = UtilityRegistration('catalog', ICatalog, catalog)
> rm.addRegistration(catalog_reg)
> catalog_reg.status = ActiveStatus
> # add the indexes after the catalog is set to the tools
> for index_name, index_attribute, idx_if, attr_call, index_type
> in indexes:
> idx = index_type(index_attribute, idx_if, attr_call)
> catalog[index_name] = idx
That seemed resonablu, unfortunately it didn't help.
Thanks anyway,
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From antonio.beamud at linkend.net Tue Nov 22 06:49:05 2005
From: antonio.beamud at linkend.net (Antonio Beamud Montero)
Date: Tue Nov 22 06:49:14 2005
Subject: [Zope3-Users] template unparsed
Message-ID: <1132660146.6671.10.camel@localhost.localdomain>
Hi all:
I've implemented a simple contact content object, and I've registered a
page as view of the content, only for testing pourpouses... The problem
is, I can see the page, but the page is not rendered with the values of
the contact... I've registered with:
No error or warning appears... I can create the contact via ZMI, but I
can see its values...
What can be the problem...?
From zedobject at gmail.com Tue Nov 22 19:34:39 2005
From: zedobject at gmail.com (Milind Khadilkar)
Date: Tue Nov 22 19:34:40 2005
Subject: [Zope3-Users] Compatibility
Message-ID: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com>
Hi,
Is it correct to say that one of the major objectives of Zope 3 as opposed
to zope-x ( viz. compatibility with Zope 2, or at least an easy way for
importing products from zope 2) has not been achieved? The 'x' was removed
on grounds of being ready for production use, not on grounds of
compatibility. The release announcement for 3.1 also mentions continuing
efforts to ease transition from zope 2 to zope 3. Is it meant to be the same
as "ability to import products"?
Thanks
ZedObject
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051123/18b06a76/attachment.htm
From srichter at cosmos.phy.tufts.edu Tue Nov 22 20:08:32 2005
From: srichter at cosmos.phy.tufts.edu (Stephan Richter)
Date: Tue Nov 22 20:08:42 2005
Subject: [Zope3-Users] Compatibility
In-Reply-To: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com>
References: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com>
Message-ID: <200511222008.32620.srichter@cosmos.phy.tufts.edu>
On Tuesday 22 November 2005 19:34, Milind Khadilkar wrote:
> Is it correct to say that one of the major objectives of Zope 3 ?as opposed
> to zope-x ( viz. compatibility with Zope 2, or at least an easy way for
> importing products from zope 2) has not been achieved? The 'x' was removed
> on grounds of being ready for production use, not on grounds of
> compatibility. The release announcement for 3.1 also mentions continuing
> efforts to ease transition from zope 2 to zope 3. Is it meant to be the
> same as "ability to import products"?
My opinion is that you will never be able to import your Zope 2 product as a
packge in plain Zope 3. HAving said that, there are continuous efforts, such
as Five and Goldegg, to bring Zope 3 technology into Zope 2.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
From srichter at cosmos.phy.tufts.edu Tue Nov 22 20:09:53 2005
From: srichter at cosmos.phy.tufts.edu (Stephan Richter)
Date: Tue Nov 22 20:09:56 2005
Subject: [Zope3-Users] template unparsed
In-Reply-To: <1132660146.6671.10.camel@localhost.localdomain>
References: <1132660146.6671.10.camel@localhost.localdomain>
Message-ID: <200511222009.53875.srichter@cosmos.phy.tufts.edu>
On Tuesday 22 November 2005 06:49, Antonio Beamud Montero wrote:
> What can be the problem...?
You need to provide us with much more information, such as the contact
implementation, the content of contact.pt, etc.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
From faassen at infrae.com Wed Nov 23 06:37:59 2005
From: faassen at infrae.com (Martijn Faassen)
Date: Wed Nov 23 06:37:53 2005
Subject: [Zope3-Users] Compatibility
In-Reply-To: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com>
References: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com>
Message-ID: <43845497.7040706@infrae.com>
Milind Khadilkar wrote:
> Is it correct to say that one of the major objectives of Zope 3 as opposed
> to zope-x ( viz. compatibility with Zope 2, or at least an easy way for
> importing products from zope 2) has not been achieved?
Unfortunately the whole 'X' story was always interpreted differently by
different people. It's unfortunate, and our (the Zope 3 project's)
mistake, that your interpretation ("Zope 2 products work in Zope 3")
ever was made possible in the first place...
> The 'x' was removed
> on grounds of being ready for production use, not on grounds of
> compatibility. The release announcement for 3.1 also mentions continuing
> efforts to ease transition from zope 2 to zope 3. Is it meant to be the same
> as "ability to import products"?
As Stephan said in his reply, I find it unlikely that you'll ever be
able to run Zope 2 products in Zope 3. We're taking the other direction
-- Zope 2 products run in Zope 2 obviously, but we're making sure that
with Five, more and more Zope 3 code also works in Zope 2. This allows
you to start porting code over to Zope 3 while it remains to work in Zope 2.
Five is hardly the perfect transition tool; most of Zope 3 code doesn't
work in Zope 2 either without significant modifications. Step by step
however this gap is being bridged.
Regards,
Martijn
From faassen at infrae.com Wed Nov 23 06:49:12 2005
From: faassen at infrae.com (Martijn Faassen)
Date: Wed Nov 23 06:49:03 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <437C6F17.4060300@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com>
Message-ID: <43845738.8050400@infrae.com>
Johan Carlsson wrote:
>
> Anyone had any success with ZCatalog in Zope 3?
Sure. I'm not sure what the problem is but I see you get a lot of
replies. We (Infrae) certainly got it working without having to patch
anything.
Um, the setup code we use it something like:
def _registerUtility(context, class_, interface, name=u''):
if not name:
cname = class_.__name__
else:
cname = name
if name and name in context:
raise ValueError, u'Utility %s already registered!' % name
utility = class_()
context[cname] = utility
registration = UtilityRegistration(name, interface, utility)
key = context.registrationManager.addRegistration(registration)
zapi.traverse(context.registrationManager, key).status = ActiveStatus
return utility
in setup code...
from zope.app.intid.interfaces import IIntIds
from zope.app.catalog.interfaces import ICatalog
from zope.app.intid import IntIds
from zope.app.catalog.catalog import Catalog
_registerUtility(default, IntIds, IIntIds)
_registerUtility(default, Catalog, ICatalog, u'my_catalog')
and then to make indexes registered, something like:
from zope.app import zapi
from zope.app.catalog.field import FieldIndex
catalog = zapi.getUtility(ICatalog, u'my_catalog')
catalog['something'] = FieldIndex('something', ISomeInterface)
_registerUtility is rather messy but it works..
Anyway, once you do get the catalog working, you may want to check out
hurry.query, which makes querying the Zope 3 catalog a lot easier (in my
opinion):
http://codespeak.net/svn/z3/hurry/trunk
Regards,
Martijn
From zedobject at gmail.com Wed Nov 23 09:51:38 2005
From: zedobject at gmail.com (Milind Khadilkar)
Date: Wed Nov 23 09:51:39 2005
Subject: [Zope3-Users] Compatibility
In-Reply-To: <43845497.7040706@infrae.com>
References: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com>
<43845497.7040706@infrae.com>
Message-ID: <116b13090511230651g5b8569e6q210e9d29ec08c190@mail.gmail.com>
In light of these insights, I feel the Zope home page should be re-drafted
so as to present alternatives clearly to newcomers. Currently, Zope 3 is not
presented prominently, causing newcomers to start with Zope 2 by default.
Regards
Milind Khadilkar
On 11/23/05, Martijn Faassen wrote:
>
> Milind Khadilkar wrote:
> > Is it correct to say that one of the major objectives of Zope 3 as
> opposed
> > to zope-x ( viz. compatibility with Zope 2, or at least an easy way for
> > importing products from zope 2) has not been achieved?
>
> Unfortunately the whole 'X' story was always interpreted differently by
> different people. It's unfortunate, and our (the Zope 3 project's)
> mistake, that your interpretation ("Zope 2 products work in Zope 3")
> ever was made possible in the first place...
>
> > The 'x' was removed
> > on grounds of being ready for production use, not on grounds of
> > compatibility. The release announcement for 3.1 also mentions continuing
> > efforts to ease transition from zope 2 to zope 3. Is it meant to be the
> same
> > as "ability to import products"?
>
> As Stephan said in his reply, I find it unlikely that you'll ever be
> able to run Zope 2 products in Zope 3. We're taking the other direction
> -- Zope 2 products run in Zope 2 obviously, but we're making sure that
> with Five, more and more Zope 3 code also works in Zope 2. This allows
> you to start porting code over to Zope 3 while it remains to work in Zope
> 2.
>
> Five is hardly the perfect transition tool; most of Zope 3 code doesn't
> work in Zope 2 either without significant modifications. Step by step
> however this gap is being bridged.
>
> Regards,
>
> Martijn
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051123/649c6b4b/attachment.htm
From johanc at easypublisher.com Wed Nov 23 10:14:38 2005
From: johanc at easypublisher.com (Johan Carlsson)
Date: Wed Nov 23 10:14:40 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <43845738.8050400@infrae.com>
References: <437C6F17.4060300@easypublisher.com> <43845738.8050400@infrae.com>
Message-ID: <4384875E.5040500@easypublisher.com>
Martijn Faassen wrote:
> Johan Carlsson wrote:
>
>>
>> Anyone had any success with ZCatalog in Zope 3?
>
>
> Sure. I'm not sure what the problem is but I see you get a lot of
> replies. We (Infrae) certainly got it working without having to patch
> anything.
>
> Um, the setup code we use it something like:
>
> def _registerUtility(context, class_, interface, name=u''):
> if not name:
> cname = class_.__name__
> else:
> cname = name
> if name and name in context:
> raise ValueError, u'Utility %s already registered!' % name
> utility = class_()
> context[cname] = utility
> registration = UtilityRegistration(name, interface, utility)
> key = context.registrationManager.addRegistration(registration)
> zapi.traverse(context.registrationManager, key).status = ActiveStatus
> return utility
>
> in setup code...
>
> from zope.app.intid.interfaces import IIntIds
> from zope.app.catalog.interfaces import ICatalog
> from zope.app.intid import IntIds
> from zope.app.catalog.catalog import Catalog
>
> _registerUtility(default, IntIds, IIntIds)
> _registerUtility(default, Catalog, ICatalog, u'my_catalog')
>
> and then to make indexes registered, something like:
>
> from zope.app import zapi
> from zope.app.catalog.field import FieldIndex
>
> catalog = zapi.getUtility(ICatalog, u'my_catalog')
> catalog['something'] = FieldIndex('something', ISomeInterface)
>
> _registerUtility is rather messy but it works..
Thanks Martijn,
From a quick glans at your code the notisable difference is
that I don't call zapi.getUtility(ICatalog, u'my_catalog') to get the
catalog, that just might do the trick. (I jsut grab the catalog from the
container: c['catalog'].
I'll let you know when I get a chance to test it.
Does you code for adding catalogs and adding fields get called
in the same request?
Mine does, it gets called right after each other, and I'm thinking
in the lines of that there is something that doesn't get setup in
the correct order, which is why I think getUtility might work better.
> Anyway, once you do get the catalog working, you may want to check out
> hurry.query, which makes querying the Zope 3 catalog a lot easier (in my
> opinion):
>
> http://codespeak.net/svn/z3/hurry/trunk
I'll check it out :-)
Cheers,
johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc@easypublisher.com
SE-113 37 STOCKHOLM
From atrium601 at gmail.com Wed Nov 23 10:23:48 2005
From: atrium601 at gmail.com (Rui Gamito)
Date: Wed Nov 23 10:23:58 2005
Subject: [Zope3-Users] Zope 3 and Plone?
Message-ID: <1132759428.8880.1.camel@localhost.localdomain>
Hi all.
Does anyone know if plone 2.1.1 works ok with zope 3?
RG
.
From reinoud.v at n.leeuwen.net Wed Nov 23 10:28:57 2005
From: reinoud.v at n.leeuwen.net (Reinoud van Leeuwen)
Date: Wed Nov 23 10:28:59 2005
Subject: [Zope3-Users] Zope 3 and Plone?
In-Reply-To: <1132759428.8880.1.camel@localhost.localdomain>
References: <1132759428.8880.1.camel@localhost.localdomain>
Message-ID: <20051123152857.GK67050@spoetnik.xs4all.nl>
On Wed, Nov 23, 2005 at 03:23:48PM +0000, Rui Gamito wrote:
> Hi all.
>
> Does anyone know if plone 2.1.1 works ok with zope 3?
Yes: it does not.
--
__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen reinoud.v@n.leeuwen.net
http://www.xs4all.nl/~reinoud
__________________________________________________
From faassen at infrae.com Wed Nov 23 11:44:07 2005
From: faassen at infrae.com (Martijn Faassen)
Date: Wed Nov 23 11:43:58 2005
Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
In-Reply-To: <4384875E.5040500@easypublisher.com>
References: <437C6F17.4060300@easypublisher.com> <43845738.8050400@infrae.com>
<4384875E.5040500@easypublisher.com>
Message-ID: <43849C57.1090303@infrae.com>
Johan Carlsson wrote:
> Martijn Faassen wrote:
[snip]
> Does you code for adding catalogs and adding fields get called
> in the same request?
Yes, it's done when an application root is installed.
Regards,
Martijn
From fbenoit at centile.com Wed Nov 23 11:54:42 2005
From: fbenoit at centile.com (Benoit frederic)
Date: Wed Nov 23 11:54:48 2005
Subject: [Zope3-Users] Plone 2.1 and Zope3
Message-ID: <1132764883.2665.34.camel@linuxfred>
Hi all,
i am new with zope and i would like to know if plone2.1 can be installed
with Zope3? (the installation documentation of plone2.1 only mention
Zope2.7 and Zope2.8).
As far as i know Zope3 needs a zcml configuration file for each Package
we install, is there some scripts to create them automatically?
thanks for anwser
Regards,
Frederic
From lists at andreas-jung.com Wed Nov 23 12:03:50 2005
From: lists at andreas-jung.com (Andreas Jung)
Date: Wed Nov 23 12:03:58 2005
Subject: [Zope3-Users] Plone 2.1 and Zope3
In-Reply-To: <1132764883.2665.34.camel@linuxfred>
References: <1132764883.2665.34.camel@linuxfred>
Message-ID:
Plone only runs with Zope 2 because of totally different Zope codebases.
-aj
--On 23. November 2005 17:54:42 +0100 Benoit frederic
wrote:
> Hi all,
> i am new with zope and i would like to know if plone2.1 can be installed
> with Zope3? (the installation documentation of plone2.1 only mention
> Zope2.7 and Zope2.8).
> As far as i know Zope3 needs a zcml configuration file for each Package
> we install, is there some scripts to create them automatically?
>
> thanks for anwser
> Regards,
>
> Frederic
>
> _______________________________________________
> Zope3-users mailing list
> Zope3-users@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051123/858a8da8/attachment.bin
From faassen at infrae.com Thu Nov 24 10:08:39 2005
From: faassen at infrae.com (Martijn Faassen)
Date: Thu Nov 24 10:08:18 2005
Subject: [Zope3-Users] Compatibility
In-Reply-To: <116b13090511230651g5b8569e6q210e9d29ec08c190@mail.gmail.com>
References: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com> <43845497.7040706@infrae.com>
<116b13090511230651g5b8569e6q210e9d29ec08c190@mail.gmail.com>
Message-ID: <4385D777.1080707@infrae.com>
Milind Khadilkar wrote:
> In light of these insights, I feel the Zope home page should be re-drafted
> so as to present alternatives clearly to newcomers. Currently, Zope 3 is not
> presented prominently, causing newcomers to start with Zope 2 by default.
>
Yes, an effort to improve the web presence of Zope 3 is sorely needed.
Regards,
Martijn
From mailinglists at xgm.de Thu Nov 24 16:46:45 2005
From: mailinglists at xgm.de (Florian Lindner)
Date: Thu Nov 24 16:46:38 2005
Subject: [Zope3-Users] PAU and Session Credentials
In-Reply-To: <200511202257.03402.mailinglists@xgm.de>
References: <200511202257.03402.mailinglists@xgm.de>
Message-ID: <200511242246.45438.mailinglists@xgm.de>
Am Sonntag, 20. November 2005 22:57 schrieb Florian Lindner:
> Hello,
> I've created and registered a PluggableAuthentication in my site. I've
> added two plugins: PrincipalFolder and SessionCredentialsPlugin and
> registered both. I've configured the PAU to use these plugins. In the
> principal folder I've created a Principal. I've also created a
> loginForm.html that looks like that:
>
[...]
No one got a idea how to make the principal folder working?
Thanks,
Florian
From christian.lueck at ruhr-uni-bochum.de Thu Nov 24 18:06:22 2005
From: christian.lueck at ruhr-uni-bochum.de (=?UTF-8?B?Q2hyaXN0aWFuIEzDvGNr?=)
Date: Thu Nov 24 17:56:17 2005
Subject: [Zope3-Users] PAU and Session Credentials
In-Reply-To: <200511202257.03402.mailinglists@xgm.de>
References: <200511202257.03402.mailinglists@xgm.de>
Message-ID: <4386476E.60601@ruhr-uni-bochum.de>
Hi Florian,
Florian Lindner wrote:
> If I try to call a page which reguired a specific permission the loginForm
> comes up. But when I enter the login and password of the Principal in the
> Principal Folder or a the manager principal defined on creation of the
> instance I just get redirected to the login page again.
I guess that you still have to grant permissions or a role to the
principal. If you want to grant it globally you should login as admin
and get to the rootfolder ("[top]"). There is a "Grant" item the ZMI
menu. On the @@grant.html view you have to choose the right source path,
probably
/++etc++site/default/YourPluggableAuthentication/YourPrincipalFolder
Yust press buttons, ZMI does the rest... :-)
> behavior before a played around with the PAU a bit now it has changed to a
> system error:
>
> TraversalError: (Principal(u'pre1'), 'getLogin')
>
Maybe it's the same error I once reported on the dev list:
http://mail.zope.org/pipermail/zope3-dev/2005-October/016163.html
I've not yet filed a report -- sorry to much to do at work last month.
Regards,
Christian
From brad at allendev.com Fri Nov 25 15:34:26 2005
From: brad at allendev.com (Brad Allen)
Date: Fri Nov 25 15:34:30 2005
Subject: [Zope3-Users] How to hide the ZMI
Message-ID:
I'm working on a simple site which, to start with, just
uses bare ZPT functionality. I've been reading Philkon's
book sections dealing with TAL, TALES, and METAL,
and it's starting to make some sense.
The part I'm stuck on is how to make the ZMI disappear
so the end user sees only the page I designed.
Do I have to go through the process of making a special skin
for my ZPT pages, or is there some easier way?
Thanks!
From brad at allendev.com Fri Nov 25 18:15:24 2005
From: brad at allendev.com (Brad Allen)
Date: Fri Nov 25 18:15:29 2005
Subject: [Zope3-Users] reST for content editors
Message-ID:
I'd prefer to allow content editors on my site to avoid having to
type HTML, and have heard that reST might be a good, wiki-like
choice. However, it's not clear to me how to get that working with
ZPT content insertions. Would I need to build a new content class for
this, or is there some easier way?
Thanks!
From mdudzikml at gmail.com Fri Nov 25 20:04:44 2005
From: mdudzikml at gmail.com (Michael Dudzik)
Date: Fri Nov 25 20:04:47 2005
Subject: [Zope3-Users] reST for content editors
Message-ID: <1132967084.21774.248351107@webmail.messagingengine.com>
On Fri, 25 Nov 2005 17:15:24 -0600, "Brad Allen"
said:
> I'd prefer to allow content editors on my site to avoid having to
> type HTML, and have heard that reST might be a good, wiki-like
> choice. However, it's not clear to me how to get that working with
> ZPT content insertions. Would I need to build a new content class for
> this, or is there some easier way?
When a similar issue came up for me, all I did was add an additional
type field to the content object then created a "render" method in the
view, something like this for a 'description' field:
def renderdescription(self):
# for rest, self.context.descriptiontype would be 'zope.source.rest'
source = zapi.createObject(None,self.context.descriptiontype,
self.context.description)
textview = zapi.getView(source,'',self.request)
html = view.render()
return html
And then just used "view/renderdescription" in my templates.
On grepping the zope codebase quickly, it looks like the more "modern"
way to do this would be to use getMultiAdapter like:
source = zapi.createObject(type,text)
renderer = zapi.getMultiAdapter((source, self.request))
return renderer.render()
I have no idea why I have an extra 'None' argument in my code, above
See zope/app/preference/browser.py for an example
From mdudzikml at gmail.com Fri Nov 25 20:07:53 2005
From: mdudzikml at gmail.com (Michael Dudzik)
Date: Fri Nov 25 20:07:58 2005
Subject: [Zope3-Users] reST for content editors
In-Reply-To: <1132967084.21774.248351107@webmail.messagingengine.com>
References: <1132967084.21774.248351107@webmail.messagingengine.com>
Message-ID: <1132967273.21993.248352267@webmail.messagingengine.com>
On Fri, 25 Nov 2005 19:04:44 -0600, "Michael Dudzik"
said:
> On Fri, 25 Nov 2005 17:15:24 -0600, "Brad Allen"
> said:
> > I'd prefer to allow content editors on my site to avoid having to
> > type HTML, and have heard that reST might be a good, wiki-like
> > choice. However, it's not clear to me how to get that working with
> > ZPT content insertions. Would I need to build a new content class for
> > this, or is there some easier way?
>
> When a similar issue came up for me, all I did was add an additional
> type field to the content object then created a "render" method in the
> view, something like this for a 'description' field:
>
> def renderdescription(self):
> # for rest, self.context.descriptiontype would be 'zope.source.rest'
> source = zapi.createObject(None,self.context.descriptiontype,
> self.context.description)
> textview = zapi.getView(source,'',self.request)
> html = view.render()
typo - should be:
html = textview.render()
> return html
>
> And then just used "view/renderdescription" in my templates.
>
> On grepping the zope codebase quickly, it looks like the more "modern"
> way to do this would be to use getMultiAdapter like:
>
> source = zapi.createObject(type,text)
> renderer = zapi.getMultiAdapter((source, self.request))
> return renderer.render()
>
> I have no idea why I have an extra 'None' argument in my code, above
>
> See zope/app/preference/browser.py for an example
From mdudzikml at gmail.com Fri Nov 25 20:13:20 2005
From: mdudzikml at gmail.com (Michael Dudzik)
Date: Fri Nov 25 20:13:21 2005
Subject: [Zope3-Users] reST for content editors
Message-ID: <1132967600.22336.248352376@webmail.messagingengine.com>
I forgot the important part.
In the template, what was previously
tal:content="view/description"
is replaced with
tal:replace="structure view/renderdescription"
On Fri, 25 Nov 2005 19:07:53 -0600, "Michael Dudzik"
said:
>
> On Fri, 25 Nov 2005 19:04:44 -0600, "Michael Dudzik"
> said:
> > On Fri, 25 Nov 2005 17:15:24 -0600, "Brad Allen"
> > said:
> > > I'd prefer to allow content editors on my site to avoid having to
> > > type HTML, and have heard that reST might be a good, wiki-like
> > > choice. However, it's not clear to me how to get that working with
> > > ZPT content insertions. Would I need to build a new content class for
> > > this, or is there some easier way?
> >
> > When a similar issue came up for me, all I did was add an additional
> > type field to the content object then created a "render" method in the
> > view, something like this for a 'description' field:
> >
> > def renderdescription(self):
> > # for rest, self.context.descriptiontype would be 'zope.source.rest'
> > source = zapi.createObject(None,self.context.descriptiontype,
> > self.context.description)
> > textview = zapi.getView(source,'',self.request)
> > html = view.render()
>
> typo - should be:
> html = textview.render()
>
> > return html
> >
> > And then just used "view/renderdescription" in my templates.
> >
> > On grepping the zope codebase quickly, it looks like the more "modern"
> > way to do this would be to use getMultiAdapter like:
> >
> > source = zapi.createObject(type,text)
> > renderer = zapi.getMultiAdapter((source, self.request))
> > return renderer.render()
> >
> > I have no idea why I have an extra 'None' argument in my code, above
> >
> > See zope/app/preference/browser.py for an example
>
> _______________________________________________
> Zope3-users mailing list
> Zope3-users@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
From brad at allendev.com Sat Nov 26 00:51:03 2005
From: brad at allendev.com (Brad Allen)
Date: Sat Nov 26 00:51:08 2005
Subject: [Zope3-Users] How to hide the ZMI
In-Reply-To:
References:
Message-ID:
>I'm working on a simple site which, to start with, just
>uses bare ZPT functionality. I've been reading Philkon's
>book sections dealing with TAL, TALES, and METAL,
>and it's starting to make some sense.
>
>The part I'm stuck on is how to make the ZMI disappear
>so the end user sees only the page I designed.
>Do I have to go through the process of making a special skin
>for my ZPT pages, or is there some easier way?
Never mind, I figured this one out. Just get rid of the
@@whatever at the end of the URL.
From mailinglists at xgm.de Sun Nov 27 08:42:55 2005
From: mailinglists at xgm.de (Florian Lindner)
Date: Sun Nov 27 08:42:43 2005
Subject: [Zope3-Users] PAU and Session Credentials
In-Reply-To: <4386476E.60601@ruhr-uni-bochum.de>
References: <200511202257.03402.mailinglists@xgm.de>
<4386476E.60601@ruhr-uni-bochum.de>
Message-ID: <200511271442.55404.mailinglists@xgm.de>
Am Freitag, 25. November 2005 00:06 schrieb Christian L?ck:
> Hi Florian,
>
> Florian Lindner wrote:
> > If I try to call a page which reguired a specific permission the
> > loginForm comes up. But when I enter the login and password of the
> > Principal in the Principal Folder or a the manager principal defined on
> > creation of the instance I just get redirected to the login page again.
>
> I guess that you still have to grant permissions or a role to the
> principal. If you want to grant it globally you should login as admin
> and get to the rootfolder ("[top]"). There is a "Grant" item the ZMI
> menu. On the @@grant.html view you have to choose the right source path,
> probably
> /++etc++site/default/YourPluggableAuthentication/YourPrincipalFolder
> Yust press buttons, ZMI does the rest... :-)
I've done that:
Selected
Nothing
PrincipalFolder
Source path
/cs/++etc++site/default/PluggableAuthentication/PrincipalFolder
> > behavior before a played around with the PAU a bit now it has changed to
> > a system error:
> >
> > TraversalError: (Principal(u'pre1'), 'getLogin')
>
> Maybe it's the same error I once reported on the dev list:
> http://mail.zope.org/pipermail/zope3-dev/2005-October/016163.html
> I've not yet filed a report -- sorry to much to do at work last month.
I don't know if it is the same... I'm still stuck with this SystemError...
Florian
From mailinglists at xgm.de Sun Nov 27 12:57:45 2005
From: mailinglists at xgm.de (Florian Lindner)
Date: Sun Nov 27 12:57:33 2005
Subject: [Zope3-Users] unauthenticated principal
Message-ID: <200511271857.46126.mailinglists@xgm.de>
Hello,
my error log has a entry to a unauthenticated principal:
unauthenticated, pre1, CS.User, beschreibung
but why is there a username (pre1) being print? What does the unauthenticated
means in that context?
Thanks,
Florian
From pms2111 at columbia.edu Mon Nov 28 06:06:31 2005
From: pms2111 at columbia.edu (pms2111@columbia.edu)
Date: Mon Nov 28 06:06:38 2005
Subject: [Zope3-Users] Installing Zope3 on Redhat AS 4 has "make check"
problems
Message-ID: <1133175991.438ae4b746b98@cubmail.cc.columbia.edu>
Hi,
I am new to Zope and am having problems installing it on a fresh Red
Had Linux AS 4 machine. In summary, Zope3 seems to compile without
error (and the daemon can even get started), but "make check"
causes errors to occur on the ZEO tests. Something about "No child
processes." It also fails on zdaemon.tests.testzdrun.ZDaemonTests.
I am not running as root.
Since this linux distribution uses Python 2.3.4 as the default, I
downloaded and compiled Python 2.4.1. The new python interpreter
was "make altinstall" into /usr/bin/python2.4 as to not clobber the
original /usr/bin/python which Red Hat utils seem to be dependent
upon.
Here is some background on my system:
$ whoami
psun
$ uname -a
Linux plato 2.6.9-22.0.1.EL #1 Tue Oct 18 18:29:40 EDT 2005 i686
i686 i386 GNU/Linux
$ /usr/bin/python2.4
Python 2.4.1 (#1, Nov 28 2005, 18:39:16)
[GCC 3.4.4 20050721 (Red Hat 3.4.4-2)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>>
The following is an abridged transcript of the steps I used to try
and install Zope3:
$ tar -zxf Zope-3.1.0.tgz
$ cd Zope-3.1.0
$ ./configure --with-python /usr/bin/python2.4
Configuring Zope installation
Using Python interpreter at /usr/bin/python2.4
$ make
/usr/bin/python2.4 install.py -q build
$ make check
/usr/bin/python2.4 install.py -q build
/usr/bin/python2.4 test.py -v
Running UNIT tests at level 1
Running UNIT tests from
/home/psun/src/Zope-3.1.0/build/lib.linux-i686-2.4
...[many many dots]...
Error in test checkReadOnlyStorage
(ZEO.tests.testConnection.FileStorageReconnectionTests)
Traceback (most recent call last):
File "/usr/lib/python2.4/unittest.py", line 270, in run
self.tearDown()
File
"/home/psun/src/Zope-3.1.0/build/lib.linux-i686-2.4/ZEO/tests/ConnectionTests.py",
line 122, in tearDown
os.waitpid(pid, 0)
OSError: [Errno 10] No child processes
Error in test checkReconnectFallback
(ZEO.tests.testConnection.FileStorageReconnectionTests)
Traceback (most recent call last):
File "/usr/lib/python2.4/unittest.py", line 270, in run
self.tearDown()
File
"/home/psun/src/Zope-3.1.0/build/lib.linux-i686-2.4/ZEO/tests/ConnectionTests.py",
line 122, in tearDown
os.waitpid(pid, 0)
OSError: [Errno 10] No child processes
[Many more errors in originating from ZEO/tests/* files omitted]
.........
Failure in test testRunIgnoresParentSignals
(zdaemon.tests.testzdrun.ZDaemonTests)
Traceback (most recent call last):
File "/usr/lib/python2.4/unittest.py", line 260, in run
testMethod()
File
"/home/psun/src/Zope-3.1.0/build/lib.linux-i686-2.4/zdaemon/tests/testzdrun.py",
line 237, in testRunIgnoresParentSignals
self.assert_(is_started, "spawned process failed to start in a
minute")
File "/usr/lib/python2.4/unittest.py", line 309, in failUnless
if not expr: raise self.failureException, msg
AssertionError: spawned process failed to start in a minute
...................
Ran 6991 tests in 311.657s
FAILED (failures=1, errors=18)
make: *** [check] Error 1
However, the daemon seems to run OK, and I can connect to
http://localhost:8080.
Can anyone help me with this? I have been racking my brains for
hours trying to figure this out.
Thanks!
--Peter Sun
From tim.peters at gmail.com Mon Nov 28 10:46:44 2005
From: tim.peters at gmail.com (Tim Peters)
Date: Mon Nov 28 10:46:53 2005
Subject: [Zope3-Users] Installing Zope3 on Redhat AS 4 has "make check"
problems
In-Reply-To: <1133175991.438ae4b746b98@cubmail.cc.columbia.edu>
References: <1133175991.438ae4b746b98@cubmail.cc.columbia.edu>
Message-ID: <1f7befae0511280746x63fc11d1xbf633acd0b1fe528@mail.gmail.com>
[pms2111@columbia.edu]
> I am new to Zope and am having problems installing it on a fresh Red
> Had Linux AS 4 machine. In summary, Zope3 seems to compile without
> error (and the daemon can even get started), but "make check"
> causes errors to occur on the ZEO tests. Something about "No child
> processes." It also fails on zdaemon.tests.testzdrun.ZDaemonTests.
> I am not running as root.
There was a long thread about a probably-related symptom in August:
http://mail.zope.org/pipermail/zope/2005-August/161025.html
Alas, AFAICT, it was never resolved. There are suggestions about what
to _try_ to do in the thread referenced above, but AFAICT they weren't
tried.
...
From pms2111 at columbia.edu Mon Nov 28 12:01:57 2005
From: pms2111 at columbia.edu (Peter Sun)
Date: Mon Nov 28 12:01:56 2005
Subject: [Zope3-Users] Installing Zope3 on Redhat AS 4 has "make check"
problems
References: <1133175991.438ae4b746b98@cubmail.cc.columbia.edu>
<1f7befae0511280746x63fc11d1xbf633acd0b1fe528@mail.gmail.com>
Message-ID: <000c01c5f43d$74426d60$0201000a@DasFuhrer>
Ahh.. .. I'm so sorry that I did not check that mail archive. Thanks for
taking the time to reply and point me in the right direction. Their
discussion is right on point.
--Peter Sun
----- Original Message -----
From: "Tim Peters"
To:
Cc:
Sent: Monday, November 28, 2005 11:46 PM
Subject: Re: [Zope3-Users] Installing Zope3 on Redhat AS 4 has "make check"
problems
[pms2111@columbia.edu]
> I am new to Zope and am having problems installing it on a fresh Red
> Had Linux AS 4 machine. In summary, Zope3 seems to compile without
> error (and the daemon can even get started), but "make check"
> causes errors to occur on the ZEO tests. Something about "No child
> processes." It also fails on zdaemon.tests.testzdrun.ZDaemonTests.
> I am not running as root.
There was a long thread about a probably-related symptom in August:
http://mail.zope.org/pipermail/zope/2005-August/161025.html
Alas, AFAICT, it was never resolved. There are suggestions about what
to _try_ to do in the thread referenced above, but AFAICT they weren't
tried.
...
From tim.peters at gmail.com Mon Nov 28 13:15:01 2005
From: tim.peters at gmail.com (Tim Peters)
Date: Mon Nov 28 13:22:07 2005
Subject: [Zope3-Users] Installing Zope3 on Redhat AS 4 has "make check"
problems
In-Reply-To: <000c01c5f43d$74426d60$0201000a@DasFuhrer>
References: <1133175991.438ae4b746b98@cubmail.cc.columbia.edu>
<1f7befae0511280746x63fc11d1xbf633acd0b1fe528@mail.gmail.com>
<000c01c5f43d$74426d60$0201000a@DasFuhrer>
Message-ID: <1f7befae0511281015o2d276cd0n374fb3983243dba8@mail.gmail.com>
[Peter Sun, about
http://mail.zope.org/pipermail/zope/2005-August/161025.html
]
> Ahh.. .. I'm so sorry that I did not check that mail archive.
Not a problem -- it was a different list, and not necessarily easy to
find that old thread.
> Thanks for taking the time to reply and point me in the right direction. Their
> discussion is right on point.
Except it didn't reach a conclusion, so eventually bit you too. If
you figure out what's really happening, please let us know! The old
thread not only didn't resolve it, it never (IIRC) even generated a
likely theory for the waitpid() failures.
BTW, you had another test (testRunIgnoresParentSignals) fail with
"spawned process failed to start in a minute". For that one, look for
file "donothing.sh" and make sure its execute bit is set. In some
combinations of Zope + Python, the execute bit on donothing.sh is
getting cleared, and then testRunIgnoresParentSignals spins its wheels
for a minute wating for donothing.sh to (despite its name ) "do
something". donothing.sh won't exist in the next Zope3 release.
From brad at allendev.com Tue Nov 29 17:45:26 2005
From: brad at allendev.com (Brad Allen)
Date: Tue Nov 29 17:45:44 2005
Subject: [Zope3-Users] need guidance
Message-ID:
I'm still in the midst of an effort at learning Zope 3, while try to
build a real website for it. I have ambitions for using Zope 3 in
several different projects, and am actively working on a Zope 3
website that I hope to have looking presentable if not fully
functional by mid-December. It will probably look a lot like a static
site at first, with a few added features like messageboard
functionality (I hope it will be ok for me to use MessageBoard from
Stephan Richter's book for a non-profit site). Later we will want to
add features for wiki, blogging, event calendar, and document library.
Another Zope 3 project for the future is to convert an ecommerce site
I had previously built in PHP. I've been using Python at my day job
now for a couple of years, and have decided I no longer have time for
PHP--I want to switch the site to Python, probably using Zope 3.
This site's main purpose is to allow customers to search, view, and
purchase from a catalog of auto parts.
With these two different types of sites in mind, some design
questions have come up in relation to Zope 3.
For the auto parts site, I am thinking about designing an AutoPart
content component. This will allow the business owner to edit his
catalog of auto parts via the web. Suppose he starts instantiating a
lot of auto parts, and editing them. Later, we decide we need to
refactor the base class, and maybe create a few child classes. That
leaves me with a big cleanup chore, because a lot of old AutoPart
instances are sitting around in the database.
What's the normal pattern for dealing with this kind of cleanup? Am I
better off just using SQL tables to provide persistence, and not
storing my object instances in ZODB? At least with SQL, it's easy
enough to manipulate the content data, and just re-instantiate
AutoPart objects from SQL when needed.
I'm trying to come to an understanding of when it's best to keep data
in the ZODB, and when it's best to use SQL instead. Maybe there are
tools for handling ZODB data that I don't know about.
Another question about ZODB is whether to use it to store page
templates. If I build a lot of ZPT pages and macros and store them
through the ZMI, and then later want to rearrange the folder
structure, I'm guessing it will be a pain to change a lot of
hard-coded path references. If I use text files outside the ZODB,
then I can use a host of text editor tools for searching across
multiple files.
I like the idea of letting end users have something like the ZMI for
editing content, and am hoping it will be possible avoid putting much
TAL and METAL markup in documents in the ZMI, but rather have the .pt
files pull content from the ZODB. However, it's not clear to me how
to make that work. The examples in the books have the .pt files in
the filesystem; I don't recall seeing any the ZMI/ZODB.
Here is another question. Suppose I'm working with a team of
developers. Should we each set up our own separate Zope3 instance,
and do SVN checkouts into our own separate, local /lib/python
directories inside the instance? How then would we merge any changes
done in the ZODB? On the other hand, having all team members try to
share a single Zope 3 instance seems unworkable...
Thanks for any insights you can provide.
From chrism at plope.com Tue Nov 29 17:50:30 2005
From: chrism at plope.com (Chris McDonough)
Date: Tue Nov 29 17:50:41 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
Message-ID: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
Hi Brad,
On Nov 29, 2005, at 5:45 PM, Brad Allen wrote:
> Here is another question. Suppose I'm working with a team of
> developers. Should we each set up our own separate Zope3 instance,
> and do SVN checkouts into our own separate, local /lib/python
> directories inside the instance? How then would we merge any
> changes done in the ZODB? On the other hand, having all team
> members try to share a single Zope 3 instance seems unworkable...
I wrote a short treatise on this subject at http://www.plope.com/
Members/chrism/zope_collab/view that you may want to take a look at.
It's written with Zope 2 in mind but the issues and mechanics remain
the same.
- C
From tl at gocept.com Tue Nov 29 18:16:48 2005
From: tl at gocept.com (Thomas Lotze)
Date: Tue Nov 29 18:33:41 2005
Subject: [Zope3-Users] (Ab)using utilities
Message-ID:
Hi,
in an application we build using Zope 3, I've been noticing a tendency to
use utilities quite a lot.
For instance, suppose we have a top level container which holds items of
type one. There are also items of types two and three somehow connected to
the top level container. To avoid having to filter item types all the
time, we don't just want to mix them in among the type one items.
However, we don't want to put folders in the top level container to hold
all type two or type three items, resp., either. The reason being a
feeling that such folders would not provide well-defined enough access:
they might be renamed, or there might be more than one folder holding
items of either type.
Our current solution is to register utilities that handle type two and
three items, and turn them into folders actually containing the items
while we're at it. This does provide uniqueness of the type two and three
item containers, as well as well-defined access by an interface name.
However, I'm not at all sure that containing application data is what
utilities are meant for. Is it?
I get a feeling that we might want folders as attributes of the top-level
container, for all the uniqueness and well-defined access that provides.
But would that be Zope-3-ish?
--
Thomas
From brad at allendev.com Tue Nov 29 22:07:13 2005
From: brad at allendev.com (Brad Allen)
Date: Tue Nov 29 22:07:18 2005
Subject: [Zope3-Users] need guidance
In-Reply-To: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
Message-ID:
Chris McDonough wrote:
>>Here is another question. Suppose I'm working with a team of
>>developers. Should we each set up our own separate Zope3 instance,
>>and do SVN checkouts into our own separate, local /lib/python
>>directories inside the instance? How then would we merge any
>>changes done in the ZODB? On the other hand, having all team
>>members try to share a single Zope 3 instance seems unworkable...
>
>I wrote a short treatise on this subject at
>http://www.plope.com/Members/chrism/zope_collab/view that you may
>want to take a look at.
>It's written with Zope 2 in mind but the issues and mechanics remain the same.
Ok, so this kind of discussion makes me wonder how much I can do
without ZODB, or at least whether I can just use the ZODB files like
any other binary files in the SVN repository. Having to write scripts
to regenerate them sounds like a lot of ass-ache. Is there any reason
why I can't just check in those data.fs files into SVN along with my
Python packages, so that other team members can check them out into
their respective Zope instances?
From duncan.mcgreggor at gmail.com Tue Nov 29 22:29:06 2005
From: duncan.mcgreggor at gmail.com (Duncan McGreggor)
Date: Tue Nov 29 22:29:35 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
Message-ID: <5f870c883c623793e47b7c4baa9e8f44@gmail.com>
On Nov 29, 2005, at 8:07 PM, Brad Allen wrote:
>>> Here is another question. Suppose I'm working with a team of
>>> developers. Should we each set up our own separate Zope3 instance,
>>> and do SVN checkouts into our own separate, local /lib/python
>>> directories inside the instance? How then would we merge any changes
>>> done in the ZODB? On the other hand, having all team members try to
>>> share a single Zope 3 instance seems unworkable...
>>
>> I wrote a short treatise on this subject at
>> http://www.plope.com/Members/chrism/zope_collab/view that you may
>> want to take a look at.
>> It's written with Zope 2 in mind but the issues and mechanics remain
>> the same.
>
> Ok, so this kind of discussion makes me wonder how much I can do
> without ZODB, or at least whether I can just use the ZODB files like
> any other binary files in the SVN repository. Having to write scripts
> to regenerate them sounds like a lot of ass-ache. Is there any reason
> why I can't just check in those data.fs files into SVN along with my
> Python packages, so that other team members can check them out into
> their respective Zope instances?
It sounds like a pain, and to be honest, at first it is a bit arduous.
Not only does it get faster and become second nature, but chunks of it
can be generalized and reused. It really doesn't take that long to get
accustomed to it. And once you start doing it regularly, you gain a
tremendous amount. Not just in the mere knowledge acquired, either...
there's a subtle shift in your programming where you give extra
attention to the data-generating/-populating code, which in turn makes
you architect your information better ahd brings higher overall levels
of organization to your project.
Additionally, the ability to generate a new instance of a project
complete with a fresh-and-ready ZODB is of immense value when working
on a project with multiple developers or teams of developers. Several
times, we have saved literally days of work taking advantage of this.
I'm sure others that take even better advantage of this have saved
perhaps weeks.
I give it two thumbs up ;-)
d
From chrism at plope.com Tue Nov 29 23:01:12 2005
From: chrism at plope.com (Chris McDonough)
Date: Tue Nov 29 23:01:33 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
Message-ID: <75EF5B11-D9DE-4489-B8AD-D86FF549850C@plope.com>
On Nov 29, 2005, at 10:07 PM, Brad Allen wrote:
>
> Chris McDonough wrote:
>>> Here is another question. Suppose I'm working with a team of
>>> developers. Should we each set up our own separate Zope3
>>> instance, and do SVN checkouts into our own separate, local /lib/
>>> python directories inside the instance? How then would we merge
>>> any changes done in the ZODB? On the other hand, having all team
>>> members try to share a single Zope 3 instance seems unworkable...
>>
>> I wrote a short treatise on this subject at http://www.plope.com/
>> Members/chrism/zope_collab/view that you may want to take a look at.
>> It's written with Zope 2 in mind but the issues and mechanics
>> remain the same.
>
> Ok, so this kind of discussion makes me wonder how much I can do
> without ZODB, or at least whether I can just use the ZODB files
> like any other binary files in the SVN repository. Having to write
> scripts to regenerate them sounds like a lot of ass-ache.
Hehe. I like that description. ;-) Yes, it is. Although there is
at least one tool that helps with just this called GenericSetup for
Zope 2. I suspect that tool could be made to work with Zope 3 with
a bit of work.
> Is there any reason why I can't just check in those data.fs files
> into SVN along with my Python packages, so that other team members
> can check them out into their respective Zope instances?
No, as long as your code matches the pickles in the database binary
stored in CVS. The problems start when you need to change the code
in a way that makes the pickles in the database incompatible with the
code; for example if you need to change the name of an instance
attribute in one of your classes; the pickles have the values stored
in the old attribute name and your new code expects the new attribute
name. So the code fails on the old data. This is of course the same
problem you have when you need to change the schema of a relational
database and you have an existing database instance. That said, Zope
3 comes with a tool named "generations" that allows you to evolve
database pickles in a uniform way by writing evolution scripts.
- C
From chrism at plope.com Tue Nov 29 23:12:48 2005
From: chrism at plope.com (Chris McDonough)
Date: Tue Nov 29 23:12:50 2005
Subject: [Zope3-Users] need guidance
In-Reply-To: <5f870c883c623793e47b7c4baa9e8f44@gmail.com>
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
<5f870c883c623793e47b7c4baa9e8f44@gmail.com>
Message-ID: <322B2C14-03AC-479C-A278-732CFD860806@plope.com>
On Nov 29, 2005, at 10:29 PM, Duncan McGreggor wrote:
> Additionally, the ability to generate a new instance of a project
> complete with a fresh-and-ready ZODB is of immense value when
> working on a project with multiple developers or teams of
> developers. Several times, we have saved literally days of work
> taking advantage of this. I'm sure others that take even better
> advantage of this have saved perhaps weeks.
Yes. You could also just check in a generated database into CVS and
use that with some of the same benefit but FWIW, I find the biggest
value in being able to review this kind of setup code is that it
serves as a kind of documentation as to *how* an iinitial database
got created. Also, setup code is often complex and subtle because
it's "where the rubber meets the road" in a production
configuration. Being able to replicate it on demand with subtle
changes (like port numbers and filenames) is valuable when you want
to roll out a system into production.
- C
From brad at allendev.com Wed Nov 30 00:57:05 2005
From: brad at allendev.com (Brad Allen)
Date: Wed Nov 30 00:57:09 2005
Subject: [Zope3-Users] need guidance
In-Reply-To: <5f870c883c623793e47b7c4baa9e8f44@gmail.com>
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
<5f870c883c623793e47b7c4baa9e8f44@gmail.com>
Message-ID:
Duncan McGreggor
>It sounds like a pain, and to be honest, at first it is a bit
>arduous. Not only does it get faster and become second nature, but
>chunks of it can be generalized and reused. It really doesn't take
>that long to get accustomed to it. And once you start doing it
>regularly, you gain a tremendous amount. Not just in the mere
>knowledge acquired, either... there's a subtle shift in your
>programming where you give extra attention to the
>data-generating/-populating code, which in turn makes you architect
>your information better ahd brings higher overall levels of
>organization to your project.
So this style of Zope 3 development involves not using
ZODB so much for permanent storage, but instead as a
temporary scaffolding on which to hang the current version
of class instances and their content. When you refactor
your classes and interfaces, you just re-instantiate everything
into the ZODB to recreate the site.
It sounds great, except not all data can be simply regenerated.
For stuff like port numbers and configuration, fine, it can be
in ZCML or embedded in Python scripts. But the site content
generated by end users has to be stored somewhere, too,.
If you throw away your ZODB and regenerate it, what happens
to that data? Does your regeneration script transfer
all that data to the newly generated ZODB?
I'd be interested in seeing the particulars of how
you guys do that stuff. I've yet to run across a direct
mention of how to create an arbitrary ZODB and
start reading and writing objects. That seems to
be a big piece missing from my understanding
of how to work with Zope 3. Every ZODB example
I've seen in the books seems to involve creating a content
object that can be added via the ZMI. However, I'm
not finished with either book, and I have very likely
missed something.
From chrism at plope.com Wed Nov 30 01:17:56 2005
From: chrism at plope.com (Chris McDonough)
Date: Wed Nov 30 01:18:06 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
<5f870c883c623793e47b7c4baa9e8f44@gmail.com>
Message-ID:
> So this style of Zope 3 development involves not using
> ZODB so much for permanent storage, but instead as a
> temporary scaffolding on which to hang the current version
> of class instances and their content. When you refactor
> your classes and interfaces, you just re-instantiate everything
> into the ZODB to recreate the site.
For development, yes.
>
> It sounds great, except not all data can be simply regenerated.
> For stuff like port numbers and configuration, fine, it can be
> in ZCML or embedded in Python scripts. But the site content
> generated by end users has to be stored somewhere, too,.
> If you throw away your ZODB and regenerate it, what happens
> to that data? Does your regeneration script transfer
> all that data to the newly generated ZODB?
While you're developing, it's much easier because the *content* in
your ZODB doesn't typically have any value during development. If it
does have value during development, you have a development model
that's not similar to mine.
But obviously, after you go into production, the content does have
value, and preserving this value is the purpose of GenericSetup for
Zope 2. It's a "dump and reload" solution which allows you to create
a represention of your ZODB data and its associated hierarchy as
files on a filesystem. You can basically push a button to dump the
data in your ZODB ro files, and then create a new ZODB, instantiate
the tool, and push a button to reload it. Zope 3's "filesystem
synchronization" capability is similar in concept, although I don't
know if that has been maintained recently.
> I'd be interested in seeing the particulars of how
> you guys do that stuff.
I do it all the time for customer jobs and there are examples in CMF
for Zope 2 (e.g. the "SiteGenerator") but I don't have any code that
uses Zope 3 that does site generation.
> I've yet to run across a direct
> mention of how to create an arbitrary ZODB and
> start reading and writing objects. That seems to
> be a big piece missing from my understanding
> of how to work with Zope 3. Every ZODB example
> I've seen in the books seems to involve creating a content
> object that can be added via the ZMI. However, I'm
> not finished with either book, and I have very likely
> missed something.
There are tons of examples about how to access ZODB data outside of
the context of Zope around, do a little googling. The thing that
might make it a little mindbending is that "accessing data in ZODB"
is just.. Python. You open the database, get the root Zope object,
and then traverse to an object in the database (usually via getattr
or getitem or whatever the folder API is) and call methods on it or
read attributes from it or whatever. There's really not much to it.
It's largely the same as writing code in your content classes, but
you can do it from a Python prompt. Zope 2 has "zopectl debug" which
dumps you off at a Python prompt with the name "app" built in to the
root Zope object.
Note that this is not particular to any version of Zope. Zope is
just a consumer of ZODB, and the issues are the same no matter what
consumer of ZODB you're using.
- C
From alen.stanisic at gmail.com Wed Nov 30 02:02:37 2005
From: alen.stanisic at gmail.com (Alen Stanisic)
Date: Wed Nov 30 02:02:53 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
Message-ID: <1133334157.3761.76.camel@localhost.localdomain>
Hi Brad,
On Tue, 2005-11-29 at 21:07 -0600, Brad Allen wrote:
[...]
> Ok, so this kind of discussion makes me wonder how much I can do
> without ZODB, or at least whether I can just use the ZODB files like
> any other binary files in the SVN repository. Having to write scripts
> to regenerate them sounds like a lot of ass-ache. Is there any reason
> why I can't just check in those data.fs files into SVN along with my
> Python packages, so that other team members can check them out into
> their respective Zope instances?
I might be missing something but not sure why would one want to store a
database in SVN. I could understand that people doing TTW Zope 2
development would have source code in ZODB but Zope 3 does not have any
TTW development functionality at the moment and all of your source
should be on the file system. Python scripts could automate building a
site or site utilities and I would have that sort of stuff in svn. But
as far as persistent content goes this is more of a data
backup/migration issue. fssync I think was mentioned on the list for
pulling content objects out of ZODB in Zope3 on the file system but not
sure if it is available yet.
Alen
From duncan.mcgreggor at gmail.com Wed Nov 30 04:44:22 2005
From: duncan.mcgreggor at gmail.com (Duncan McGreggor)
Date: Wed Nov 30 04:44:59 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
<5f870c883c623793e47b7c4baa9e8f44@gmail.com>
Message-ID:
On Nov 29, 2005, at 10:57 PM, Brad Allen wrote:
>> It sounds like a pain, and to be honest, at first it is a bit
>> arduous. Not only does it get faster and become second nature, but
>> chunks of it can be generalized and reused. It really doesn't take
>> that long to get accustomed to it. And once you start doing it
>> regularly, you gain a tremendous amount. Not just in the mere
>> knowledge acquired, either... there's a subtle shift in your
>> programming where you give extra attention to the
>> data-generating/-populating code, which in turn makes you architect
>> your information better ahd brings higher overall levels of
>> organization to your project.
>
> So this style of Zope 3 development involves not using
> ZODB so much for permanent storage, but instead as a
> temporary scaffolding on which to hang the current version
> of class instances and their content. When you refactor
> your classes and interfaces, you just re-instantiate everything
> into the ZODB to recreate the site.
Like Chris said, a qualified "yes" -- i.e., during development. For a
production alternative, he pointed to the generations tool. I haven't
had a need to use it yet, but I've heard folks talking about it.
> It sounds great, except not all data can be simply regenerated.
> For stuff like port numbers and configuration, fine, it can be
> in ZCML or embedded in Python scripts. But the site content
> generated by end users has to be stored somewhere, too.
I have several sites with base content that is pre-populated from
python scripts and external files.
> If you throw away your ZODB and regenerate it, what happens
> to that data? Does your regeneration script transfer
> all that data to the newly generated ZODB?
Whenever I am told by client that they want me to build an application
for them, and they want to be able to add data/content while I do it, I
either gently educate them on the proven process that we use, or I walk
away from the project. Maintaining content during development is almost
always a nightmare. There are tools to use to enable this...
approach... but in my mind (and many others') it's just not a good way
to do development.
To come a little closer to answering your question, the only time that
I have ever needed this kind of thing is on projects where we were
delivering a product to multiple clients, pre-populated with default
content. All of that content was added via python.
> I'd be interested in seeing the particulars of how
> you guys do that stuff. I've yet to run across a direct
> mention of how to create an arbitrary ZODB and
> start reading and writing objects.
As soon as you create an instance of a content object, you've written
to the ZODB. Whenever you render a page that presents a content object,
you've read from the ZODB. z3 "protects" the developer from the ZODB.
You never have to do direct reads/writes. You're simply operating
within a z3 "app"...
As for particulars, there are several emails in the archives for this
list that detail z3 site setups. Even better, there are examples in the
wild. IIRC, the cubic project had an example for this, and the
"worldcookery" demo site might too. I'd certainly check out schooltool
to see what they have done. Code-based site
creation/setup/configuration will provide you with lots of ideas,
hands-on examples, and a good sense of how to approach this.
> That seems to
> be a big piece missing from my understanding
> of how to work with Zope 3. Every ZODB example
> I've seen in the books seems to involve creating a content
> object that can be added via the ZMI. However, I'm
> not finished with either book, and I have very likely
> missed something.
Yeah, I think you're looking for code-based content addition -- is that
right? If so, you're going to want to spend some time looking at
zope.app.zapi (a lot of which comes from zope.component). In
particular, the createObject() function. Take a look at those projects
I mentioned above... and other folks may have good suggestions for code
examples on site creation and pre-population of content.
Hang in there ;-)
d
From srichter at cosmos.phy.tufts.edu Wed Nov 30 07:55:10 2005
From: srichter at cosmos.phy.tufts.edu (Stephan Richter)
Date: Wed Nov 30 07:55:23 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
Message-ID: <200511300755.10932.srichter@cosmos.phy.tufts.edu>
On Tuesday 29 November 2005 17:45, Brad Allen wrote:
> Another question about ZODB is whether to use it to store page
> templates. If I build a lot of ZPT pages and macros and store them
> through the ZMI, and then later want to rearrange the folder
> structure, I'm guessing it will be a pain to change a lot of
> hard-coded path references. If I use text files outside the ZODB,
> then I can use a host of text editor tools for searching across
> multiple files.
>
> I like the idea of letting end users have something like the ZMI for
> editing content, and am hoping it will be possible avoid putting much
> TAL and METAL markup in documents in the ZMI, but rather have the .pt
> files pull content from the ZODB. However, it's not clear to me how
> to make that work. The examples in the books have the .pt files in
> the filesystem; I don't recall seeing any the ZMI/ZODB.
We are currently not supporting TTW development. Thus, in Zope 3 you cannot
develop templates TTW well yet.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
From srichter at cosmos.phy.tufts.edu Wed Nov 30 07:56:18 2005
From: srichter at cosmos.phy.tufts.edu (Stephan Richter)
Date: Wed Nov 30 07:56:25 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
Message-ID: <200511300756.18636.srichter@cosmos.phy.tufts.edu>
On Tuesday 29 November 2005 17:45, Brad Allen wrote:
> Here is another question. Suppose I'm working with a team of
> developers. Should we each set up our own separate Zope3 instance,
> and do SVN checkouts into our own separate, local /lib/python
> directories inside the instance? How then would we merge any changes
> done in the ZODB? On the other hand, having all team members try to
> share a single Zope 3 instance seems unworkable...
Yep, SVN is the way to go; we do this in Zope 3 projects all the time. Since
no code lives in the ZODB, there is no need for sharing ZODB content.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
From brad at allendev.com Wed Nov 30 12:38:02 2005
From: brad at allendev.com (Brad Allen)
Date: Wed Nov 30 12:38:13 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
<5f870c883c623793e47b7c4baa9e8f44@gmail.com>
Message-ID:
At 1:17 AM -0500 11/30/05, Chris McDonough wrote:
>While you're developing, it's much easier because the *content* in
>your ZODB doesn't typically have any value during development. If
>it does have value during development, you have a development model
>that's not similar to mine.
Well, I generally try to follow an iterative approach like that
described in Agile or Extreme Programming styles
( ). The idea is
to get something into production very quickly, let users bang on it,
and then produce a new version based on feedback from users...and
then do it again, and again, etc. There is no big lead time for
"development-only"; the cycle is more like
develop-release-use-develop-release-use, etc. During that cycle, end
user data needs to be carried over to each new version.
At 2:44 AM -0700 11/30/05, Duncan McGreggor wrote:
>Whenever I am told by client that they want me to build an
>application for them, and they want to be able to add data/content
>while I do it, I either gently educate them on the proven process
>that we use, or I walk away from the project. Maintaining content
>during development is almost always a nightmare. There are tools to
>use to enable this... approach... but in my mind (and many others')
>it's just not a good way to do development.
In this case, the users want to start using a message board ASAP.
This means they will be adding content to ZODB right away. I don't
see how I can get away from having them put content into ZODB.
At 1:17 AM -0500 11/30/05, Chris McDonough wrote:
>But obviously, after you go into production, the content does have
>value, and preserving this value is the purpose of GenericSetup for
>Zope 2. It's a "dump and reload" solution which allows you to
>create a represention of your ZODB data and its associated hierarchy
>as files on a filesystem. You can basically push a button to dump
>the data in your ZODB ro files, and then create a new ZODB,
>instantiate the tool, and push a button to reload it. Zope 3's
>"filesystem synchronization" capability is similar in concept,
>although I don't know if that has been maintained recently.
I guess another approach would be to NOT throw away my ZODB, but just
delete and regenerate selected container folders, leaving the user
content alone. From your postings about how the ZODB is accessible
directly from Python, it sounds like that should be do-able.
Hopefully it won't be too tough to tackle...
At 2:44 AM -0700 11/30/05, Duncan McGreggor wrote:
>Yeah, I think you're looking for code-based content addition -- is
>that right? If so, you're going to want to spend some time looking
>at zope.app.zapi (a lot of which comes from zope.component). In
>particular, the createObject() function. Take a look at those
>projects I mentioned above... and other folks may have good
>suggestions for code examples on site creation and pre-population of
>content.
Thanks. A little searching turned up
, which looks like the
place for me to dig into. I will also check out the source code.
Thanks!
From duncan.mcgreggor at gmail.com Wed Nov 30 12:45:50 2005
From: duncan.mcgreggor at gmail.com (Duncan McGreggor)
Date: Wed Nov 30 12:46:21 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
<5f870c883c623793e47b7c4baa9e8f44@gmail.com>
Message-ID: <85a8631f46dbba13f272d1dc134ab0ec@gmail.com>
On Nov 30, 2005, at 10:38 AM, Brad Allen wrote:
> At 2:44 AM -0700 11/30/05, Duncan McGreggor wrote:
>> Whenever I am told by client that they want me to build an
>> application for them, and they want to be able to add data/content
>> while I do it, I either gently educate them on the proven process
>> that we use, or I walk away from the project. Maintaining content
>> during development is almost always a nightmare. There are tools to
>> use to enable this... approach... but in my mind (and many others')
>> it's just not a good way to do development.
>
> In this case, the users want to start using a message board ASAP. This
> means they will be adding content to ZODB right away. I don't see how
> I can get away from having them put content into ZODB.
Just tell them that ASAP == 'when development for the first release has
been completed' ;-)
>> Yeah, I think you're looking for code-based content addition -- is
>> that right? If so, you're going to want to spend some time looking at
>> zope.app.zapi (a lot of which comes from zope.component). In
>> particular, the createObject() function. Take a look at those
>> projects I mentioned above... and other folks may have good
>> suggestions for code examples on site creation and pre-population of
>> content.
>
> Thanks. A little searching turned up
> , which looks like the place
> for me to dig into. I will also check out the source code. Thanks!
Hmm, again, I think you *might* want to stay away from an approach that
interacts directly with the ZODB. Unless you're not using z3/Zope 2...
If you want pre-populated content in a z3 project, you probably want to
be creating site instances to which you would add utilities and
content.
I may be misperceiving your needs, though...
d
From brad at allendev.com Wed Nov 30 13:41:47 2005
From: brad at allendev.com (Brad Allen)
Date: Wed Nov 30 13:41:53 2005
Subject: [Zope3-Users] list archives for zope3-users
Message-ID:
I'm looking for a better way to search and read the list archives for
this list. Here are the list archives that I know about.
Text file archives:
http://mail.zope.org/pipermail/zope3-users
Searchable mail archive:
http://www.mail-archive.com/zope3-users@zope.org/
Gmane provides a variety of ways to view the list, but the search
options are still pretty limited.
http://dir.gmane.org/gmane.comp.web.zope.zope3.user
I wish there was some way to access mailing list archives via a POP3
interface, so that I could use my mail app of choice. In my case,
Eudora is my favorite app for searching and viewing mailing lists.
Unfortunately, I've only got a couple of months of Zope3-users in
Eudora. I haven't found that the text file archives to be easily
importable.
Does anyone else on this list use Eudora? If so, I'd very much
appreciate a copy of your Eudora mailbox file for the Zope3 users
list.
If anyone else has thoughts on the best way to search the mailing
list archives, I'd appreciate hearing about it. I'd prefer to avoid
asking questions that others have already asked.
From srichter at cosmos.phy.tufts.edu Wed Nov 30 13:49:29 2005
From: srichter at cosmos.phy.tufts.edu (Stephan Richter)
Date: Wed Nov 30 13:49:32 2005
Subject: [Zope3-Users] list archives for zope3-users
In-Reply-To:
References:
Message-ID: <200511301349.30007.srichter@cosmos.phy.tufts.edu>
On Wednesday 30 November 2005 13:41, Brad Allen wrote:
> If anyone else has thoughts on the best way to search the mailing
> list archives, I'd appreciate hearing about it. I'd prefer to avoid
> asking questions that others have already asked.
I use google. :-)
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
From duncan.mcgreggor at gmail.com Wed Nov 30 13:49:24 2005
From: duncan.mcgreggor at gmail.com (Duncan McGreggor)
Date: Wed Nov 30 13:49:54 2005
Subject: [Zope3-Users] list archives for zope3-users
In-Reply-To:
References:
Message-ID:
On Nov 30, 2005, at 11:41 AM, Brad Allen wrote:
> If anyone else has thoughts on the best way to search the mailing list
> archives, I'd appreciate hearing about it. I'd prefer to avoid asking
> questions that others have already asked.
Hey Brad, I feel like we're becoming best friends ;-)
I use google. Here's a google search string example for searching the
zope3-users maillist for "ZODB":
site:http://mail.zope.org location:pipermail/zope3-users ZODB
d
From duncan.mcgreggor at gmail.com Wed Nov 30 13:52:06 2005
From: duncan.mcgreggor at gmail.com (Duncan McGreggor)
Date: Wed Nov 30 13:52:20 2005
Subject: [Zope3-Users] list archives for zope3-users
In-Reply-To:
References:
Message-ID: <70f65c5060e783b811845becef3e326e@gmail.com>
On Nov 30, 2005, at 11:49 AM, Duncan McGreggor wrote:
>> If anyone else has thoughts on the best way to search the mailing
>> list archives, I'd appreciate hearing about it. I'd prefer to avoid
>> asking questions that others have already asked.
>
> Hey Brad, I feel like we're becoming best friends ;-)
>
> I use google. Here's a google search string example for searching the
> zope3-users maillist for "ZODB":
>
> site:http://mail.zope.org location:pipermail/zope3-users ZODB
Doh. My bad, that should have been:
site:http://mail.zope.org inurl:pipermail/zope3-users ZODB
From brad at allendev.com Wed Nov 30 14:02:12 2005
From: brad at allendev.com (Brad Allen)
Date: Wed Nov 30 14:02:20 2005
Subject: [Zope3-Users] Direct ZODB access in a Zope3 instance
Message-ID:
Based on discussion in the 'need guidance' thread, I started looking into
how to access the Zope ZODB directly from within Python scripts.
I haven't gotten very far yet. I'm still at the beginning of the docs at
trying out the example code.
I got stuck trying to open the Data.fs file in my Zope instance.
Python 2.4.2 (#2, Sep 30 2005, 21:19:01)
[GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ZODB import FileStorage, DB
>>> storage = FileStorage.FileStorage('Data.fs')
Traceback (most recent call last):
File "", line 1, in ?
File
"/usr/lib/python2.4/site-packages/ZODB/FileStorage/FileStorage.py",
line 112, in __init__
self._lock_file = LockFile(file_name + '.lock')
File "/usr/lib/python2.4/site-packages/ZODB/lock_file.py", line 57,
in __init__
self._fp = open(path, 'r+')
IOError: [Errno 13] Permission denied: 'Data.fs.lock'
>>> storage = FileStorage.FileStorage('Data.fs')
I tried shutting down the Zope 3 instance, the the same traceback
appeared anyway.
I checked to make sure I had the filename right:
>>> import os
>>> os.path.isfile('Data.fs')
True
How do I clear the lock on the file?
Thanks!
From lists at nabble.com Wed Nov 30 14:05:09 2005
From: lists at nabble.com (kooto (sent by Nabble.com))
Date: Wed Nov 30 14:05:11 2005
Subject: [Zope3-Users] Re: list archives for zope3-users
In-Reply-To:
References:
Message-ID: <1721636.post@talk.nabble.com>
Brad Allen wrote:
>
> I'm looking for a better way to search and read the list archives for
> this list. Here are the list archives that I know about.
> ...
>
> If anyone else has thoughts on the best way to search the mailing
> list archives, I'd appreciate hearing about it. I'd prefer to avoid
> asking questions that others have already asked.
>
Nabble is another searchable archive like Gmane.
http://www.nabble.com/Zope-f6706.html
The difference is that it allows the cataloging of all Zope lists (zope, zope3, users, dev, db, plone ...) into one combined forum where users can search and browse in one single place, vs having to go to each individual list to search.
It also has a powerful search and a clean UI.
--
Sent from the Zope3 - users forum at Nabble.com:
http://www.nabble.com/list-archives-for-zope3-users-t647430.html#a1721636
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051130/3581bf77/attachment.htm
From brad at allendev.com Wed Nov 30 14:13:45 2005
From: brad at allendev.com (Brad Allen)
Date: Wed Nov 30 14:13:54 2005
Subject: [Zope3-Users] need guidance
In-Reply-To: <85a8631f46dbba13f272d1dc134ab0ec@gmail.com>
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
<5f870c883c623793e47b7c4baa9e8f44@gmail.com>
<85a8631f46dbba13f272d1dc134ab0ec@gmail.com>
Message-ID:
At 10:45 AM -0700 11/30/05, Duncan McGreggor wrote:
>
>Hmm, again, I think you *might* want to stay away from an approach
>that interacts directly with the ZODB. Unless you're not using
>z3/Zope 2...
I didn't see this posting until after I started a new thread called
"Direct ZODB access in a Zope3 instance". So, why is it a bad
idea?
From brad at allendev.com Wed Nov 30 14:25:57 2005
From: brad at allendev.com (Brad Allen)
Date: Wed Nov 30 14:26:01 2005
Subject: [Zope3-Users] need guidance
In-Reply-To: <200511300755.10932.srichter@cosmos.phy.tufts.edu>
References:
<200511300755.10932.srichter@cosmos.phy.tufts.edu>
Message-ID:
At 7:55 AM -0500 11/30/05, Stephan Richter wrote:
>We are currently not supporting TTW development. Thus, in Zope 3 you cannot
>>develop templates TTW well yet.
Ok, that alters my plans somewhat. But I can still have end
user contribute/edit content within the ZMI, right? Maybe a ZPT
component just isn't the right choice for that.
I will see if I can get Zwiki installed and running sometime today.
Maybe that will provide a more appropriate content component
for end users.
From dman at dman13.dyndns.org Wed Nov 30 14:31:59 2005
From: dman at dman13.dyndns.org (Derrick Hudson)
Date: Wed Nov 30 14:31:34 2005
Subject: [Zope3-Users] Re: list archives for zope3-users
In-Reply-To: <70f65c5060e783b811845becef3e326e@gmail.com>
References:
<70f65c5060e783b811845becef3e326e@gmail.com>
Message-ID: <20051130193159.GA31815@dman13.dyndns.org>
On Wed, Nov 30, 2005 at 11:52:06AM -0700, Duncan McGreggor wrote:
| On Nov 30, 2005, at 11:49 AM, Duncan McGreggor wrote:
|
| >>If anyone else has thoughts on the best way to search the mailing
| >>list archives, I'd appreciate hearing about it. I'd prefer to avoid
| >>asking questions that others have already asked.
| >
| >Hey Brad, I feel like we're becoming best friends ;-)
| >
| >I use google. Here's a google search string example for searching the
| >zope3-users maillist for "ZODB":
| >
| >site:http://mail.zope.org location:pipermail/zope3-users ZODB
|
| Doh. My bad, that should have been:
|
| site:http://mail.zope.org inurl:pipermail/zope3-users ZODB
^^^^^
OOh, nice. I didn't know about that feature, but wished there was
something like that. Thanks.
-D
--
Better a little with righteousness
than much gain with injustice.
Proverbs 16:8
www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyndns.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051130/4cf8dade/attachment.bin
From lists at nabble.com Wed Nov 30 14:32:13 2005
From: lists at nabble.com (kooto (sent by Nabble.com))
Date: Wed Nov 30 14:32:14 2005
Subject: [Zope3-Users] Re: list archives for zope3-users
In-Reply-To: <1721636.post@talk.nabble.com>
References:
<1721636.post@talk.nabble.com>
Message-ID: <1722071.post@talk.nabble.com>
kooto wrote:
>
>
> Brad Allen wrote:
>>
>> If anyone else has thoughts on the best way to search the mailing
>> list archives, I'd appreciate hearing about it. I'd prefer to avoid
>> asking questions that others have already asked.
>>
>
> Nabble is another searchable archive like Gmane. http://www.nabble.com/Zope-f6706.html
>
Actually, Nabble also has a combined archive for all Zope3 lists under the Zope category:
http://www.nabble.com/Zope3-f13629.html
I saw the suggestion of using Google "site:http://mail.zope.org inurl:pipermail/zope3-users ZODB" to search. I guess this is ok as long as you realize that Google does not index all the messages - typically, 10% of the pages from a site can get into the Google index (and most of them tend to be old). Plus, the recent messages will not be in Google index for sometime so you will probably miss the recent messages in Google search.
--
Sent from the Zope3 - users forum at Nabble.com:
http://www.nabble.com/list-archives-for-zope3-users-t647430.html#a1722071
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051130/1f7393cb/attachment.htm
From duncan.mcgreggor at gmail.com Wed Nov 30 14:33:06 2005
From: duncan.mcgreggor at gmail.com (Duncan McGreggor)
Date: Wed Nov 30 14:33:36 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
<5f870c883c623793e47b7c4baa9e8f44@gmail.com>
<85a8631f46dbba13f272d1dc134ab0ec@gmail.com>
Message-ID: <491cfe5b4f8427e3fd6e99e1a1ea337e@gmail.com>
On Nov 30, 2005, at 12:13 PM, Brad Allen wrote:
>> Hmm, again, I think you *might* want to stay away from an approach
>> that interacts directly with the ZODB. Unless you're not using
>> z3/Zope 2...
>
> I didn't see this posting until after I started a new thread called
> "Direct ZODB access in a Zope3 instance". So, why is it a bad
> idea?
Well, it's a great idea if your application is non-zope python with a
need for "versioned" storage.
It's not such a good idea if your application is a zope app because
those app servers do so much of the work for you, with many years of
honing put into them.
The best thing to do is learn how to use the app server/framework such
that your work is minimized (both short- and long-term) and such that
the final product is a stable as possible (building on prior, tested,
and proven work).
Direct access in a z3 app is usually made for debugging purposes, and
used with the pdb, can be very effective for hunting down and solving
issues.
As per your other email, the reason you had problems was because your
z3 instance was already running. If you are not using ZEO, you need to
stop z3 in order to gain access to the ZODB.
Have you seen Benji's quick start guide? In addition to Stephan
Richter's book, you ought to read Philipp von Weitershausen's book too.
As of zope3.1, it's a little out of date, but only in a few areas. The
conceptual explanations and careful, hands-on, examples-based approach
is pure gold. His and Stephan's book are the perfect couple ;-)
Links:
http://worldcookery.com/ (Philipp's book is here)
http://www.benjiyork.com/quick_start/
In addition, I've written a python script that auto-generates a starter
z3 project for you, after asking a couple questions. If you want to use
it, I'd be more than willing to answer any questions about it (an thus
improve it) off-list. You can download it here:
http://www.zope.org/Members/adytumsolutions/z3project_starter
I'll got back to your original post and try to do a better job of
answering your questions.
d
From dman at dman13.dyndns.org Wed Nov 30 14:39:02 2005
From: dman at dman13.dyndns.org (Derrick Hudson)
Date: Wed Nov 30 14:41:45 2005
Subject: [Zope3-Users] Re: need guidance
In-Reply-To:
References:
<200511300755.10932.srichter@cosmos.phy.tufts.edu>
Message-ID: <20051130193902.GB31815@dman13.dyndns.org>
On Wed, Nov 30, 2005 at 01:25:57PM -0600, Brad Allen wrote:
| At 7:55 AM -0500 11/30/05, Stephan Richter wrote:
| >We are currently not supporting TTW development. Thus, in Zope 3 you cannot
| >>develop templates TTW well yet.
|
| Ok, that alters my plans somewhat. But I can still have end
| user contribute/edit content within the ZMI, right?
Of course users can contribute content. Don't confuse content with
content type. The type involves coding and extending the
functionality of the base system. Content itself is basically just
text. Content is the same as 'data'. What users can't contribute,
because TTW isn't well supported, is code and behavior. The
developers will produce the code and implement all the needed
behavior, then the users will produce the content.
| Maybe a ZPT component just isn't the right choice for that.
|
| I will see if I can get Zwiki installed and running sometime today.
| Maybe that will provide a more appropriate content component
| for end users.
It is if you are looking for the dynamic that a wiki provides.
HTH,
-D
--
> SELECT * FROM users WHERE clue > 0
0 rows returned
(http://www.thinkgeek.com/images/products/zoom/no-clue.jpg)
www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyndns.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051130/9502ff70/attachment.bin
From michael at d2m.at Wed Nov 30 14:12:35 2005
From: michael at d2m.at (Michael Haubenwallner)
Date: Wed Nov 30 14:43:34 2005
Subject: [Zope3-Users] Re: list archives for zope3-users
In-Reply-To:
References:
Message-ID:
Brad Allen wrote:
> I'm looking for a better way to search and read the list archives for
> this list. Here are the list archives that I know about.
>
> Text file archives:
> http://mail.zope.org/pipermail/zope3-users
>
> Searchable mail archive:
> http://www.mail-archive.com/zope3-users@zope.org/
>
> Gmane provides a variety of ways to view the list, but the search
> options are still pretty limited.
> http://dir.gmane.org/gmane.comp.web.zope.zope3.user
>
Gmane recently added a new search interface, start here:
http://search.gmane.org/?group=gmane.comp.web.zope.zope3.user
Michael
--
http://zope.org/Members/d2m
http://planetzope.org
From michael at d2m.at Wed Nov 30 14:07:37 2005
From: michael at d2m.at (Michael Haubenwallner)
Date: Wed Nov 30 14:47:41 2005
Subject: [Zope3-Users] Re: list archives for zope3-users
In-Reply-To:
References:
Message-ID:
Brad Allen wrote:
> I'm looking for a better way to search and read the list archives for
> this list. Here are the list archives that I know about.
>
> Text file archives:
> http://mail.zope.org/pipermail/zope3-users
>
> Searchable mail archive:
> http://www.mail-archive.com/zope3-users@zope.org/
>
> Gmane provides a variety of ways to view the list, but the search
> options are still pretty limited.
> http://dir.gmane.org/gmane.comp.web.zope.zope3.user
>
> I wish there was some way to access mailing list archives via a POP3
> interface, so that I could use my mail app of choice. In my case, Eudora
> is my favorite app for searching and viewing mailing lists.
> Unfortunately, I've only got a couple of months of Zope3-users in
> Eudora. I haven't found that the text file archives to be easily
> importable.
>
> Does anyone else on this list use Eudora? If so, I'd very much
> appreciate a copy of your Eudora mailbox file for the Zope3 users list.
>
> If anyone else has thoughts on the best way to search the mailing list
> archives, I'd appreciate hearing about it. I'd prefer to avoid asking
> questions that others have already asked.
You can use
http://www.google.com/search?sitesearch=mail.zope.org&q=zope3-users
for a start and refine the query with your searchterm
Michael
--
http://zope.org/Members/d2m
http://planetzope.org
From chrism at plope.com Wed Nov 30 14:49:11 2005
From: chrism at plope.com (Chris McDonough)
Date: Wed Nov 30 14:49:23 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
<5f870c883c623793e47b7c4baa9e8f44@gmail.com>
Message-ID: <7C72D99E-BFD3-454D-AFE5-FA02205E32FD@plope.com>
On Nov 30, 2005, at 12:38 PM, Brad Allen wrote:
> At 1:17 AM -0500 11/30/05, Chris McDonough wrote:
>> While you're developing, it's much easier because the *content* in
>> your ZODB doesn't typically have any value during development. If
>> it does have value during development, you have a development
>> model that's not similar to mine.
>
> Well, I generally try to follow an iterative approach like that
> described in Agile or Extreme Programming styles ( en.wikipedia.org/wiki/Extreme_Programming > ). The idea is to get
> something into production very quickly, let users bang on it, and
> then produce a new version based on feedback from users...and then
> do it again, and again, etc. There is no big lead time for
> "development-only"; the cycle is more like develop-release-use-
> develop-release-use, etc. During that cycle, end user data needs to
> be carried over to each new version.
FWIW, I wouldn't characterize the system into which those users put
content into as a development system (aka development sandbox).
Instead I'd call it a "demo" sandbox. Sure, the data in a demo
sandbox needs to be enduring or you can't do iterative development
because the customer will have no frame of reference between
iterations, as all of their content will be gone.
But data in a *development* sandbox is not very interesting and can
be changed or thrown out at will. For example, I really don't care
what's in a news article on my development sandbox. If the title of
a news article says "Bush Invades Grenada" or "Ipsum Dolorum", it's
all the same to me. I'm not actually reading the content, I'm just
making it possible for the customer to add and change content
abstractly. What the content says has no value to me.
But there is the issue of keeping the demo system up to date while I
do development because it *does* have value to the customer, so it's
of course something that needs to be dealt with.
So to get there, the mechanics I use are like this:
- I create a buildout that builds the software I need to create a
sandbox.
Typically, this is Zope, ZEO, maybe a relational database, maybe
an LDAP
database, and so forth. I've done this many times, so it typically
only takes me half a day or so, because I steal judiciously
from other buildouts I've done. The job of the buildout is to put
files
on the filesystem.
- I create a site generator, that puts some data I need into the ZODB.
The job of the site generator is to put data in the ZODB. This also
takes just a little bit, typically, because I've done it many times.
- As I do development, I create scripts which evolve the database
content
from one code generation to the next as necessary.
When I want to set up a new development sandbox, I run the buildout
and the site generator on my own system. Then I continue to write code.
When I finish "iteration 1", I set up a demo sandbox for the customer
on one of his systems using the same buildout and site generator
mechanisms.
I continue developing in my development sandbox on my own system.
In the meantime, presumably my customer is using and evaluating the
"demo" system, which is running a only-slightly-older version of the
code than what exists in my development sandbox, and also contains
"real" data due to the fact they're adding and changing content.
The customer never sees my development sandbox, only I do. I don't
have his new content, but I don't really care. I'm able to deal more
abstractly with the problem we're trying to solve than he or she
might be, so having the most up to date content (or sometimes not
having any content at all) in my development sandbox is not really an
issue for me.
In the meantime, if I'm working with other developers, they also run
the buildout and site generator code and work in a sandbox *on their
own system*. They never see page renderings generated by my
development sandbox. I never see theirs. When we need to share
code, we do so by checking our Zope product code in and out of CVS or
subversion. We maintain the site generator and buildout as necessary
as things change.
As we move towards another iteration, if I need to, while I'm writing
code, I write evolution scripts that are capable of fixing ZODB data
in place between milestone revisions of code. I happen to know
exactly when I need to do this, because I've been working with ZODB
for many years. Other developers working with me do the same.
When the project reaches a development milestone, I push out my
development code to the customer's demo system and run the evolution
scripts on the demo system. Their content remains intact, and they
begin evaluating again and we start all over again for the next
milestone.
You say above that there's no big lead time for "development only".
If you mean that you can't make time to do the above, I can
understand the sentiment; I've heard it many times. But I just
haven't found any other sane way to do it over the years I've been
using Zope, so I feel like I've learned how to do this "the hard way"
and I think it has a lot of value; every other method I've tried
falls down in one or more important ways, particularly when I need to
do collaborative development.
HTH,
- C
From duncan.mcgreggor at gmail.com Wed Nov 30 14:52:43 2005
From: duncan.mcgreggor at gmail.com (Duncan McGreggor)
Date: Wed Nov 30 14:53:16 2005
Subject: [Zope3-Users] need guidance
In-Reply-To:
References:
Message-ID: <5af44b2a9c7f9ad72e076c29949944b9@gmail.com>
On Nov 29, 2005, at 3:45 PM, Brad Allen wrote:
> I'm still in the midst of an effort at learning Zope 3, while try to
> build a real website for it. I have ambitions for using Zope 3 in
> several different projects, and am actively working on a Zope 3
> website that I hope to have looking presentable if not fully
> functional by mid-December.
Do you have a zope2 background? With a background in zope2 and twisted,
I found z3 very easy (delightful) to learn. My first z3 site was done
from scratch, with graphic design, custom user-editable content in
under 3 weeks. I was an instant z3 fan.
> Another Zope 3 project for the future is to convert an ecommerce site
> I had previously built in PHP. I've been using Python at my day job
> now for a couple of years, and have decided I no longer have time for
> PHP--I want to switch the site to Python, probably using Zope 3. This
> site's main purpose is to allow customers to search, view, and
> purchase from a catalog of auto parts.
You will definitely want to start getting familiar with pythonic site
creation in z3, particularly, setting up a catalog (IntId, Catalog,
Index-creation, etc.). All of my query needs are met (so far) by simple
python calls to catalog.SearchResults and then a lambda for sorting.
Martijn Faassen wrote a great query wrapper called "hurry" that you
will almost certainly want to investigate/use:
http://faassen.n--tree.net/blog/view/weblog/2005/09/09/0
> For the auto parts site, I am thinking about designing an AutoPart
> content component. This will allow the business owner to edit his
> catalog of auto parts via the web. Suppose he starts instantiating a
> lot of auto parts, and editing them. Later, we decide we need to
> refactor the base class, and maybe create a few child classes. That
> leaves me with a big cleanup chore, because a lot of old AutoPart
> instances are sitting around in the database.
As Chris mentioned before, to my understanding, this is a perfect
use-case for generations, so you should be covered (if it's up to
date...).
> I'm trying to come to an understanding of when it's best to keep data
> in the ZODB, and when it's best to use SQL instead. Maybe there are
> tools for handling ZODB data that I don't know about.
As a general trend, people that have highly-relational data tend to
prefer using RDBMSs. I have no current projects for which I use an
RDBMS, but I have in the past. I also have a very strong preference for
object databases ;-)
> Another question about ZODB is whether to use it to store page
> templates. If I build a lot of ZPT pages and macros and store them
> through the ZMI, and then later want to rearrange the folder
> structure, I'm guessing it will be a pain to change a lot of
> hard-coded path references. If I use text files outside the ZODB, then
> I can use a host of text editor tools for searching across multiple
> files.
I think this has been answered. There's no current TTW dev. But you
will come to dearly love filesystem dev, especially with multiple
developers working on the same code ;-)
> I like the idea of letting end users have something like the ZMI for
> editing content, and am hoping it will be possible avoid putting much
> TAL and METAL markup in documents in the ZMI, but rather have the .pt
> files pull content from the ZODB. However, it's not clear to me how to
> make that work. The examples in the books have the .pt files in the
> filesystem; I don't recall seeing any the ZMI/ZODB.
Perhaps I can clarify with a typical example:
* you have a z3 project, all the code is on the file system
* you will create custom content objects
* you will create a "skin" for the project -- this is how it will look
to end users
* you can use the ZMI for administration tasks (such as
creating/editing content) -- you can customize the ZMI to look like
anything you want
* you can modify your custom skin to present various editing/management
options to the end users
Perhaps this makes thins more clear?
> Here is another question. Suppose I'm working with a team of
> developers. Should we each set up our own separate Zope3 instance, and
> do SVN checkouts into our own separate, local /lib/python directories
> inside the instance?
IMO, definitely ;-)
HTH,
d
From dman at dman13.dyndns.org Wed Nov 30 15:01:26 2005
From: dman at dman13.dyndns.org (Derrick Hudson)
Date: Wed Nov 30 15:01:01 2005
Subject: [Zope3-Users] Re: need guidance
In-Reply-To:
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
<5f870c883c623793e47b7c4baa9e8f44@gmail.com>
Message-ID: <20051130200126.GC31815@dman13.dyndns.org>
On Wed, Nov 30, 2005 at 11:38:02AM -0600, Brad Allen wrote:
| At 1:17 AM -0500 11/30/05, Chris McDonough wrote:
| >While you're developing, it's much easier because the *content* in
| >your ZODB doesn't typically have any value during development. If
| >it does have value during development, you have a development model
| >that's not similar to mine.
|
| Well, I generally try to follow an iterative approach like that
| described in Agile or Extreme Programming styles
| ( ). The idea is
| to get something into production very quickly, let users bang on it,
| and then produce a new version based on feedback from users...and
| then do it again, and again, etc. There is no big lead time for
| "development-only"; the cycle is more like
| develop-release-use-develop-release-use, etc. During that cycle, end
| user data needs to be carried over to each new version.
This isn't a problem. This is really the same thing, just with
shorter cycles. (you show a 'release' step in your lifecycle, and
each release is just that -- a release to production, not an
intermediary part of developer collaboration)
| At 2:44 AM -0700 11/30/05, Duncan McGreggor wrote:
| >Whenever I am told by client that they want me to build an
| >application for them, and they want to be able to add data/content
| >while I do it, I either gently educate them on the proven process
| >that we use, or I walk away from the project. Maintaining content
| >during development is almost always a nightmare. There are tools to
| >use to enable this... approach... but in my mind (and many others')
| >it's just not a good way to do development.
|
| In this case, the users want to start using a message board ASAP.
For a messageboard you may want to see if any existing solutions fit
your needs. Perhaps you don't need to custom code your own. If you
do need to custom code your own, perhaps the message board example (in
the zope3 repository) can serve as a suitable starting point.
| This means they will be adding content to ZODB right away. I don't
| see how I can get away from having them put content into ZODB.
I see now. This is a different story than I understood from the
earlier messages. Earlier you talked about putting the ZODB in svn
for developer collaboration. That is quite different from the
scenario of upgrading a production system.
It sounds like the 'generations' framework is what you need.
In your cycle you will develop and once you release version 1, a
production system will be deployed. Users using that system will
create content in the ZODB.
Based on feedback you begin developing version 2. Version 2 may
change the schema of some objects. When you release version 2, the
production system will be upgraded. Using the generations framework
the existing content in the ZODB will be evolved to fit the new schema
and the application is again available for users to continue adding
content.
| At 1:17 AM -0500 11/30/05, Chris McDonough wrote:
| >But obviously, after you go into production, the content does have
| >value, and preserving this value is the purpose of GenericSetup for
| >Zope 2. It's a "dump and reload" solution which allows you to
| >create a represention of your ZODB data and its associated hierarchy
| >as files on a filesystem. You can basically push a button to dump
| >the data in your ZODB ro files, and then create a new ZODB,
| >instantiate the tool, and push a button to reload it. Zope 3's
| >"filesystem synchronization" capability is similar in concept,
| >although I don't know if that has been maintained recently.
Chris is describing part of the same process. He is talking about
techniques to upgrade the software on a production system without
losing preexisting data on that production system.
During development and pre-release testing you won't have any critical
data and each developer can simply recreate a new ZODB to work with.
For more automated and repeatable testing your team should create some
sample data and the scripts to populate a new installation with that
data. If you don't do this then each time a developer or tester
starts over with a clean database, then will need to expend time
manually creating ad-hoc sample data to test with.
The difference is the development environment vs. the production
environment.
HTH,
-D
--
A violent man entices his neighbor
and leads him down a path that is not good.
Proverbs 16:29
www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyndns.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051130/da308417/attachment.bin
From duncan.mcgreggor at gmail.com Wed Nov 30 15:05:01 2005
From: duncan.mcgreggor at gmail.com (Duncan McGreggor)
Date: Wed Nov 30 15:05:31 2005
Subject: [Zope3-Users] content object migration (was: need guidance)
In-Reply-To: <7C72D99E-BFD3-454D-AFE5-FA02205E32FD@plope.com>
References:
<6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com>
<5f870c883c623793e47b7c4baa9e8f44@gmail.com>
<7C72D99E-BFD3-454D-AFE5-FA02205E32FD@plope.com>
Message-ID: <39ec67c12c70a18813e0fcce6cd1c36f@gmail.com>
On Nov 30, 2005, at 12:49 PM, Chris McDonough wrote:
> As we move towards another iteration, if I need to, while I'm writing
> code, I write evolution scripts that are capable of fixing ZODB data
> in place between milestone revisions of code. I happen to know
> exactly when I need to do this, because I've been working with ZODB
> for many years. Other developers working with me do the same.
Awesome email, Chris -- thanks for sharing!
In particular, I am tantalized by the paragraph above ;-) As I alluded
in a previous post, this has been a very painful point for myself an
other developers with whom I have worked. For one client, we used the
CMFPlone.MigrationTool on a Zope2/Plone project where content addition
was occurring throughout the development phase. I found the tool
cumbersome and the whole process most painful and distasteful.
Do you employ an analogous tool or elegant manual approach for z3
projects? If you have no tool, have you guys compiled a best practices
doc (informal or otherwise) whereby those of us inexperienced in these
particulars could benefit?
Thanks!
d
From alecmunro at gmail.com Wed Nov 30 15:11:46 2005
From: alecmunro at gmail.com (Alec Munro)
Date: Wed Nov 30 15:11:50 2005
Subject: [Zope3-Users] My principals not being found by PrincipalRegistry
Message-ID: <9819d58b0511301211m11fc0cf3q154bfd2332d06eb1@mail.gmail.com>
Specifically, this relates to the undo page.
I have my own class of principal folder, as well as several classes of
principals. These work for login, but when looking at the undo page, I
get "not available".
Is there something I manually have to do in order to get my principals
to be available in the PrincipalRegistry, or have I screwed up
somewhere else?
Thanks,
Alec Munro
From brad at allendev.com Wed Nov 30 16:05:33 2005
From: brad at allendev.com (Brad Allen)
Date: Wed Nov 30 16:05:42 2005
Subject: [Zope3-Users] need guidance
In-Reply-To: <5af44b2a9c7f9ad72e076c29949944b9@gmail.com>
References:
<5af44b2a9c7f9ad72e076c29949944b9@gmail.com>
Message-ID:
At 12:52 PM -0700 11/30/05, Duncan McGreggor wrote:
>Do you have a zope2 background? With a background in zope2 and
>twisted, I found z3 very easy (delightful) to learn. My first z3
>site was done from scratch, with graphic design, custom
>user-editable content in under 3 weeks. I was an instant z3 fan.
I did spend some time trying out Zope 2 a couple of years ago, but
didn't get very far past the basics. That was before I had really
gotten into Python. What got me interested in Z3 was that our local
Python user group (http://www.python.org/dfw) has been recently
looking at a variety of Python web frameworks. Based on reading parts
of Stephan Richter's Zope 3 Developer's Guide, I got the impression
that Zope 3 was the most mature and featureful available. The intros
to chapters 7 and 8 had some inspiring bits about the kind of
experience and thinking went into the architecture of Zope 3.
We had some meetings involving getting Zope 3 up and running on
Ubuntu, the MessageBoard tutorial, etc. After awhile, I realized that
we really should have started with the Philikon book first (Web
Component Development with Zope 3), because it spent more time
explaining the basics (like TAL and METAL, for example). I'm still
going back and forth between the two books as I continue learning
Zope 3.
Btw, I found that the cheapest place to buy both Zope 3 books is
Nerdbooks.com. I'm a bit biased, because Nerdbooks provides a meeting
space for the DFW Python user's group, and I want to promote
Nerdbooks as much as possible due to their generosity in hosting user
groups in the Dallas area, as well as the way they provide an unusual
combination of a vast technical book selection with the lowest prices
around (lower than Amazon by a good bit).
As for the easiness and delightfulness of learning Zope 3, that's not
the general perception in our Python user group, and clearly a big
part of the Python community is diverted into other frameworks such
as Django, TurboGears, and TwistedWeb. How to improve the perception
of Zope 3 could probably be a separate discussion thread unto itself.
I favor the notion of making a separate Zope 3 site, or at least
clearing out the old, outdated documentation at the current site. For
a newbie, it's hard to tell what's current and what's outdated.
At 12:33 PM -0700 11/30/05, Duncan McGreggor wrote:
>As per your other email, the reason you had problems was because
>your z3 instance was already running. If you are not using ZEO, you
>need to stop z3 in order to gain access to the ZODB.
>
>Have you seen Benji's quick start guide? In addition to Stephan
>Richter's book, you ought to read Philipp von Weitershausen's book
>too. As of zope3.1, it's a little out of date, but only in a few
>areas. The conceptual explanations and careful, hands-on,
>examples-based approach is pure gold. His and Stephan's book are the
>perfect couple ;-)
Actually, I totally missed Benji's "Zope 3 Quick Start Guide"
(). I had seen mention of it
on the list, but I somehow got it mixed up with "Zope 3 in 30
Minutes" .
From alecmunro at gmail.com Wed Nov 30 16:16:12 2005
From: alecmunro at gmail.com (Alec Munro)
Date: Wed Nov 30 16:16:14 2005
Subject: [Zope3-Users] Permission required for renaming?
Message-ID: <9819d58b0511301316iea84etc2c42448c15a1b2c@mail.gmail.com>
Hi List,
My users are unable to rename things, seemingly everywhere. They can
add, remove, but not rename, or cut/copy. I'm not sure how to set the
permission for this.
Thanks,
Alec
From brad at allendev.com Wed Nov 30 17:07:14 2005
From: brad at allendev.com (Brad Allen)
Date: Wed Nov 30 17:07:18 2005
Subject: [Zope3-Users] Direct ZODB access in a Zope3 instance
In-Reply-To:
References: