[Zope] Re: use Data.fs from mountpoint B to "populate" mountpoint A - how?
Please send all Zope related questions to a Zope related mailing list and not to me privately. Usually, I do not answer questions sent to me privately! I added "zope@zope.org". Christoph Berendes wrote at 2005-10-21 14:12 -0400: >I created a mount point, /default_site and a corresponding directory >var/default_site. I build my plone site from scratch into >default_site/site001, and all is good. > >I then create a second mount point /kitchensbyartisan and a >corresponding directory var/kitchensbyartisan. I copy >var/default_site/Data.fs into var/kitchensbyartisan. Make the new_site >mount point in the ZMI, restart a lot etc. > >However, when I then navigate in the ZMI to kitchensbyartisan, it's >empty and doesn't show site001 (or anything) > >Do I need something fancier than the following in zope.conf, some >reference to default_site? > > >mount-point /kitchensbyartisan > >path $INSTANCE/var/kitchensbyartisan/Data.fs > > When you use this simple mount-point syntax, then the mount path is coded into the generated storage and you cannot mount the storage under a different path. Actually, the mount-point syntax is much more complex than the form you use above. Among others, it supports mount-point mount-path:storage-path "mount-path" describes how you reach the mount point in the mounting application and "storage-path" how you find the mounted object from the storage root. An example would be: mount-point /F1/F2/XXX:/S1/XXX Note that the last component in both paths *MUST* be identical (otherwise, Zope's url construction no longer works with URL traversal). Usually, the "storage-path" will look like "/XXX" (where "XXX" is some id (without '/')). If "storage-path" is not given, it defaults to "mount-path" (this explains why you do not see anything in your storage). To summarize: * always explicitely give a storage path * use a storage path of the form "/" * then you can mount the storage at different places *BUT* you must never mount with a different id (the mount point must have the same id as that of the mounted object). -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope Install Best Practice - Newbie Questions
Russel, we do install our zope/plone instances in a simmilar way you did. in addition to the steps you described we the do the following - make Zope-2.7 and Zope-2.8 a softlink to the respective source directory and then create the instances from the Zope-2.X/bin directory. the mkzope/zeoinstance scripts create startupscripts with hardcoded paths. With ZopeX a softlink you can easily make updates to minor new zope releases for all your instances - in the zopeusers homedirectory we have a Products directory where we have all the products installed. In the instances/Product folders we then link to them. Again we have Plone-1/2/2.1 links pointing to the respective Releases, so we can make minor Plone updates without hassle. robert Russell Winter wrote: Folks, First post from a real newbie, I have currently got Zope installed under a test server and would like to ensure that I get things right for our production environment. Being a complete newbie to Zope I would like to be sure I am doing things right and understood the numerous articles I have read, any assistance would be greatly appreciated. Currently, I made a user account; " zopeuser ", I installed Zope via this account and I can access the management interface without issues and managed to get a Plone installation working with mod_rewrite & mod_proxy via apache (we have a cPanel dedicated server). However, I think I may have made some fundamental administration or poor practice errors. When I compiled Zope, my source is in the same directory as my final instance, is this a security issue or at least poor practice, is there a better way to do this? If, so could someone point me in the right procedural direction to install Zope. I shall be uninstalling the instance I have, so a fresh install will be completed for the production instance. We are planning on running several Plone instances for different domain web-sites, so that each site can be managed separately by each different department. Does anybody know of any issues that we are likely to bump in to running Zope under a cPanel based server, to date I have manually added Plone accounts in the httpd.conf but will also be adding a few standard cPanel Apache based domains through the control panel as well, in time. Thanks for your thoughts, I am learning still and hopefully learning quickly, so hopefully my very basic questions will reduce over a short period of time . Regards, Russ Winter This e-mail message and accompanying data may contain information that is confidential and subject to privilege. If you are not the intended recipient, you are notified that any use, dissemination, distribution or copying of this message or data is prohibited. If you have received this e-mail in error please notify us immediately and delete all material pertaining to this e-mail. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] fine grained, dynamic permissions based on attribute values
On 10/18/05, Chris Crownhart <[EMAIL PROTECTED]> wrote: > Good day, > > I am wondering if/how I could control the permissions on an object based > on the value of an attribute. > > So, as an example, I have multiple users, and multiple values for the > category field. I would like User A to access the object if the > category ='financial', and User B access the object if the > category='other'. If, as Mark asked, different users with different access privileges have different roles, then how about writing a condition (TALES expression) for the View action of your content type? Something along the lines of python: member and (member.has_role('Accountant') and context.category=='financial') or (member.has_role('Editor') and context.category=='other') Don't quote me on the exact expression, though, you should test that. Rob ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Zope Install Best Practice - Newbie Questions
Folks, First post from a real newbie, I have currently got Zope installed under a test server and would like to ensure that I get things right for our production environment. Being a complete newbie to Zope I would like to be sure I am doing things right and understood the numerous articles I have read, any assistance would be greatly appreciated. Currently, I made a user account; " zopeuser ", I installed Zope via this account and I can access the management interface without issues and managed to get a Plone installation working with mod_rewrite & mod_proxy via apache (we have a cPanel dedicated server). However, I think I may have made some fundamental administration or poor practice errors. When I compiled Zope, my source is in the same directory as my final instance, is this a security issue or at least poor practice, is there a better way to do this? If, so could someone point me in the right procedural direction to install Zope. I shall be uninstalling the instance I have, so a fresh install will be completed for the production instance. We are planning on running several Plone instances for different domain web-sites, so that each site can be managed separately by each different department. Does anybody know of any issues that we are likely to bump in to running Zope under a cPanel based server, to date I have manually added Plone accounts in the httpd.conf but will also be adding a few standard cPanel Apache based domains through the control panel as well, in time. Thanks for your thoughts, I am learning still and hopefully learning quickly, so hopefully my very basic questions will reduce over a short period of time . Regards, Russ Winter This e-mail message and accompanying data may contain information that is confidential and subject to privilege. If you are not the intended recipient, you are notified that any use, dissemination, distribution or copying of this message or data is prohibited. If you have received this e-mail in error please notify us immediately and delete all material pertaining to this e-mail. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope crashing a RedHat installation?
On 21 Oct 2005, at 20:50, Aaron Bauman wrote: Hi, We're running Zope 2.7.3, Plone 1.0.something relatively large Data.fs ( > 300MB ) Decent amount of anonymous traffic, But relatively low administrative use (1 - 2 users usually). Could these factors be brining the machine down? I've been getting intermittent 'corrupted data' messages for some time, but only recently been experiencing serious downtime. Is it time to seriously look at cleaning up the ZODB and upgrading? Or is my web host just trying to sell me more hardware? Not sure what you specifically mean by "crashing" and "bringing down", but Zope and/or Python simply aren't known for crashing the operating system. What exactly are the symptoms that you are seeing? jens ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope crashing a RedHat installation?
On Fri, 2005-10-21 at 15:50 -0400, Aaron Bauman wrote: > Hi, Hi, > We're running Zope 2.7.3, Plone 1.0.something > relatively large Data.fs ( > 300MB ) > But relatively low administrative use (1 - 2 users usually). > Could these factors be brining the machine down? What products? just Plone 1.0.x? > I've been getting intermittent 'corrupted data' messages for some > time, but > only recently been experiencing serious downtime. What kind of hosting: dedicated? shared? -- Administration & Formation à l'administration de serveurs dédiés: http://www.google.fr/search?q=aspo+infogerance+serveur ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Zope crashing a RedHat installation?
Hi, We're running Zope 2.7.3, Plone 1.0.something relatively large Data.fs ( > 300MB ) Decent amount of anonymous traffic, But relatively low administrative use (1 - 2 users usually). Could these factors be brining the machine down? I've been getting intermittent 'corrupted data' messages for some time, but only recently been experiencing serious downtime. Is it time to seriously look at cleaning up the ZODB and upgrading? Or is my web host just trying to sell me more hardware? Any help much appreciated, - Aaron Bauman http://www.gaycenter.org ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] __getitem__ and returning a PageTemplateFile instance
Anders Bruun Olsen wrote at 2005-10-21 15:06 +0200: > ... >Ahh.. that makes sense I guess. It just seems counterintuitive that you >can return a string in a normal function, but not in __getitem__. Can can return a string from "__getitem__" (without problem), *but* you cannot use this string during URL traversal. By the way, it does not matter for URL traversal whether the string (or other simple type object or object without docstring) was returned by "__getitem__", "getattr" or "__bobo_traverse__" (these are the possibilities to obtain the subobject during URL traversal) -- the publisher will in all cases reject it. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] FTP or WebDav creates empty files
D Washburn wrote at 2005-10-21 10:03 -0400: >I have a desktop program that develops DTML pages for a ZOPE/PLONE >website. I planned to upload them via FTP or WebDav. > >When they arrive they are empty. This usually works. Are you sure, your files do not contain bugs? Can you upload the same file via HTTP without problems? The so called "safety belt" may also cause problems -- the safety belt is there to protect against overwriting a modified document. CMF had a bug that in case of a differing safety belt, the target object was cleared. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZCatalog: searching where on index == another index
Etienne Labuschagne wrote at 2005-10-21 13:00 +0200: >Is there a way to search for all the records where one indexed field >equals another indexed field? > >Equivalent SQL query would be: > >SELECT * FROM table WHERE field1 = field2 If the index has only a few different values, enumerating them may be feasible. With "AdvancedQuery", this could look like: from Products.AdvancedQuery import Or, Eq query = Or(*[Eq(I1,v) & Eq(I2,v) for v in I1.unique(Values)]) -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] [OT] ParsedXML dev mail list
On 10/21/05, Chris Withers <[EMAIL PROTECTED]> wrote: > Garito wrote: > > Sorry for the off topic but I try to subscribe to ParsedXML dev mail > > list but I can't (mail list doesn't exists) > > Doesn't look like it. Is ParsedXML an Infrae or a Zope Corp product? > > You could always try asking about your problem on this list... It was originally a Zope Corp product, and still lives in the zope.org CVS. I don't think anyone here is currently using it for anything, though. There is a zope-xml list that came into existance back when we were developing that, but its been nothing but spambait for the past couple of years. It should probably be retired. -Fred -- Fred L. Drake, Jr. "Society attacks early, when the individual is helpless." --B.F. Skinner ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Question: What Workflow tool to choose?
--On 21. Oktober 2005 12:18:31 -0400 Robert Boyd <[EMAIL PROTECTED]> wrote: I've been tasked with rapidly developing a demo for a proposed workflow application using Zope. I have plenty of CMF experience including customized workflows based on DCWorkflow, but I'm wondering what other workflows are actively supported and of production quality. In the past I've read blurbs about OpenFlow, ReFlow, and a Google search today turned up those and Metaflow and some others. However, many of them are dead-ends. The only reasonable workflow systems are DCWorkflow and Alphaflow (requires Plone). Everything else is more or less old and unmaintained or at least not very much usable. -aj pgpO0PXUDdugf.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Question: What Workflow tool to choose?
I've been tasked with rapidly developing a demo for a proposed workflow application using Zope. I have plenty of CMF experience including customized workflows based on DCWorkflow, but I'm wondering what other workflows are actively supported and of production quality. In the past I've read blurbs about OpenFlow, ReFlow, and a Google search today turned up those and Metaflow and some others. However, many of them are dead-ends. Openflow's site is a 404 Not Found (in Italian) Metaflow: a 2002 article on ZopeMag sounded interesting, but no link to the software and I can't find it. Plus, old posts on this list make it sound problematic. Reflow turned into CMFOpenflow, which was a fork of Openflow? JaWE2Openflow sounded interesting, but the links are 404 Not Found. Is CMF(DC)Workflow my best option? My application would most likely *not* need other CMF tools, I might want it as a straight Zope 2 application. Also, I'm very new to Zope 3, does it include any workflow or have any available? Thanks, Rob ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: implicit vs. explicit ownership?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Withers wrote: > Jürgen Herrmann wrote: > >> hmm, i'm a bit confused now. do you say that changeOwnershipType() only >> has to do with "executeable ownership"? > > > Yep, I think so... > >> especially i have to know which methods of the IOwned interface are >> essential and have to be reimplemented properly on my objects. > > > Why do you think you need to implement IOwned? Unless Juergen's object is "code-like", IOwned is a distraction; ownable objects exist only to prevent trojaning (as Chris correctly pointed out earlier). >> ...but the fog is clearing up a little bit now, i thought that the >> "owner" role would be completely dynamically assigned to a user by >> getRolesInContext, now i see that this is done at object creation time >> and more than one user can have the local role "owner" on an object. > > > The Owner role is something of a dead chicken. Don't rely on it and > ignore it as best you can unless you're really sure what you're doing... I don't know why you would say that. The "Owner" local role (as opposed to executable ownership) is widely used to allow creators of content to edit it in places where they would otherwise be unable to do so. >> for my use cases i'd prefer to let getRolesInContext() add the "owner" >> role to it's return list if the (runtime and proprietary) owner check >> tells it to. any contraindications (besides performance, possibly)? It *is* possible to hijack the role computation here; getting it right is tricky, however, and when it is wrong, your error messages are going to be inscrutable. The "right" place to do this might be in a custom user folder, rather than in content. PAS, for instance, has the concept of making the role computation for the *user* pluggable. Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDWQ/D+gerLs4ltQ4RAqGEAKC90sJHo7JjtfSGowvBpLbGxpvt4wCdGCm5 Yp0mtxCE1M2hL6SIgYRF7wo= =l8J6 -END PGP SIGNATURE- ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: inheriting from SimpleUserFolder's User
Florent Guillaume wrote: Actually all third-party userfolders I know of reimplement allowed() in terms of calling getRolesInContext(). SUF doesn't, it aims to keep Simple ;-) I would like to see this fixed in Zope though, I agree the code that's there probably isn't much fo a performance win... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] write file to FS (LocalFS?)
Dieter Maurer wrote: Be careful with External Methods and locks: An External Method does not share the module namespace with the same External Methods in other workers. Thus, you should not use locks defined in the source file of the External Method (but outside in a true Python module). Good point! Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: implicit vs. explicit ownership?
Jürgen Herrmann wrote: hmm, i'm a bit confused now. do you say that changeOwnershipType() only has to do with "executeable ownership"? Yep, I think so... especially i have to know which methods of the IOwned interface are essential and have to be reimplemented properly on my objects. Why do you think you need to implement IOwned? ...but the fog is clearing up a little bit now, i thought that the "owner" role would be completely dynamically assigned to a user by getRolesInContext, now i see that this is done at object creation time and more than one user can have the local role "owner" on an object. The Owner role is something of a dead chicken. Don't rely on it and ignore it as best you can unless you're really sure what you're doing... for my use cases i'd prefer to let getRolesInContext() add the "owner" role to it's return list if the (runtime and proprietary) owner check tells it to. any contraindications (besides performance, possibly)? Well, confusion. I'd just get a new role name and use that for whatever you want to do... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] [OT] ParsedXML dev mail list
Garito wrote: Sorry for the off topic but I try to subscribe to ParsedXML dev mail list but I can't (mail list doesn't exists) Doesn't look like it. Is ParsedXML an Infrae or a Zope Corp product? You could always try asking about your problem on this list... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] __getitem__ and returning a PageTemplateFile instance
Anders Bruun Olsen wrote: Ahh.. that makes sense I guess. It just seems counterintuitive that you can return a string in a normal function, but not in __getitem__. I have a feeling you're after traverse_subpath, which is available in both Python Scripts and Page Templates... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] database connections from external method
Vangelis Mihalopoulos wrote: I am loading the zodb in read-only mode. If someone breaks into Zope What do you mean by this? (which btw i believe to be very secure) The why do you consider it a risk? i don't want him to be able to directly access (read/write) the database i am using. *AFAIK*, ZSQLMethods won't do for this. Then put constraints in on your database, or make the whole connection read-only. You're really buying nothing with all this other than wasting a lot of your time... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] database connections from external method
Vangelis Mihalopoulos wrote: Tino Wildenhain wrote: The threading is handled by the ZDA, so you can use query() or what the method actually is. I couldn't find a method like that... any hints? Have a look at the ZSQL methods code, I remember this being pretty old and convoluted :-( Otoh, what do you think you gain from circumventing ZSQL Methods? Well, i am running zope under root privileges in "read-only" mode. What does this mean? What are you seeking to do or prevent? If there is a Zope break-in, What does that mean? i want to minimize interference with the database. Which database? Also, since this will be a commercial product, keeping most of the code in compiled python scripts is meaningful. As Jens already explained, .pyc's and pyo's can be decompiled in a matter of minutes, so you're getting nothing for this worry other than finding debugging a pain ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] FTP or WebDav creates empty files
I have a desktop program that develops DTML pages for a ZOPE/PLONE website. I planned to upload them via FTP or WebDav. When they arrive they are empty. I can upload graphics via FTP and the images arrive OK. So basic transfer works. Any ideas on setting or changes needed to make the text files arrive with their content as the body of a DTML document. Thanks David ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] __getitem__ and returning a PageTemplateFile instance
On Thu, Oct 20, 2005 at 09:43:24PM +0200, Dieter Maurer wrote: > >asonhe is not there, but vitester has a __getitem__ method which > >executes a PageTemplateFile instance and returns it. I.e. > Thus, it returns a string. > However, ZPublisher requires that all intermediate traversal > steps return an object which is not of a simple type and does > have a docstring. A string is a simple type, you cannot use it > during traversal... Ahh.. that makes sense I guess. It just seems counterintuitive that you can return a string in a normal function, but not in __getitem__. > >But that way I can't put any values in there. How can I do this then? > Can can return a wrapper and give it a docstring. > class Wrapper: > '''a wrapper around a string.''' # this is the docstring > def __init__(self, str): > self.str = str > def __call__(self): return self.str > Some security declarations might be necessary as well. > Probably, a class attribute "__roles__ = None" is sufficient. Okay, that will work. Thanks so much for your help, I really appreciated it. -- Anders -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS/O d--@ s:+ a-- C++ UL+++$ P++ L+++ E- W+ N(+) o K? w O-- M- V PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b++ DI+++ D+ G e- h !r y? --END GEEK CODE BLOCK-- PGPKey: http://random.sks.keyserver.penguin.de:11371/pks/lookup?op=get&search=0xD4DEFED0 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZCatalog: searching where on index == another index
--On 21. Oktober 2005 13:00:35 +0200 Etienne Labuschagne <[EMAIL PROTECTED]> wrote: Hi all, Is there a way to search for all the records where one indexed field equals another indexed field? no. -aj pgpT5FL2z86QW.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] ZCatalog: searching where on index == another index
Hi all, Is there a way to search for all the records where one indexed field equals another indexed field? Equivalent SQL query would be: SELECT * FROM table WHERE field1 = field2 I know I can get all the unique values for field1 and then do a search for records where field2 = [unique field1 values], but isn't there a better way? Etienne ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] database connections from external method
Dieter Maurer wrote: Vangelis Mihalopoulos wrote at 2005-10-19 12:22 +0300: ... I am thinking of using a Z Database Connection (mysql) from within an external method, without using Z SQL Methods, but can't figure out how i can "safely" do it Calling a "DA" object gives you a low level connection object (a "db" object). It has a "query" method. Calling it provides "safe" SQL execution. Thanks, this is what i had in mind. >From other posts, I understood that you want to do special things. Yes, this is true. In such cases, reading the source is necessary Yes, i know. But this would take me much more time than sending an email to the Zope list and getting quick help from experienced Zopistas, time that i unfortunately cannot afford. Of course, reviewing product code on other cases wasn't such a big overhead and i got my task done. -- and being prepared that things may change between releases... Of course... :-) I follow the recommendation of others to use ZSQL methods... I am loading the zodb in read-only mode. If someone breaks into Zope (which btw i believe to be very secure) i don't want him to be able to directly access (read/write) the database i am using. *AFAIK*, ZSQLMethods won't do for this. Thanks for your comments, helpful as always! - Vangelis ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )