folder name problem
Hi, using Zope 2.6.0 with Python 2.1.3 on Solaris 7, I come across the following strangeness: I have a folder called 'hq'. Inside this I want to add another folder called 'manage'. there is nothing inside hq called anything like manage. When I try to add the folder, I am told that this is a bad request, because the id 'manage' is already in use. It clearly isn't in use in this folder. Is this some kind of reserved word in Zope? thanks Ben Avery YouthNet UK
>> It clearly isn't in use in this folder. Is this some kind of reserved >> word in Zope? Jamie> yes Is there some way to discover what these reserved names are, or do people have to just stumble upon them? For example, I have an SQL table I'd like to populate via Zope. It makes sense for me to name the fields in my Formulator form the same as the column names in the table. I can't always do this however, because I run into name clashes (like "title"). It's frustrating to me that there is no namespace separation between names used internally to Zope objects and objects created by users. If anything, it seems to me it should be Zope's internals which are forced to qualify names with special prefixes and suffixes, not Zope programmers. The affected population will be much smaller. -- Skip Montanaro - skip@pobox.com http://www.mojam.com/ http://www.musi-cal.com/
Hi Skip,
>> It clearly isn't in use in this folder. Is this some kind of reserved >> word in Zope?
Jamie> yes
Is there some way to discover what these reserved names are, or do people have to just stumble upon them? For example, I have an SQL table I'd like to populate via Zope. It makes sense for me to name the fields in my Formulator form the same as the column names in the table. I can't always do this however, because I run into name clashes (like "title"). It's frustrating to me that there is no namespace separation between names used internally to Zope objects and objects created by users. If anything, it seems to me it should be Zope's internals which are forced to qualify names with special prefixes and suffixes, not Zope programmers. The affected population will be much smaller.
If one would make this distinction programmatically, these "internal" names would be no longer available for use; e.g. it would not possible to reach the ZMI via the "/manage" url. You would have to write a script or something for everything that should be public accessible (e.g. there has to be a "manage" script if the root accessing the "programatic" manage-method, if this method should not be reachable via the web.) If there would be just prefixes/postfixes naming conventions, this could have been possible, but beside of the "manage_" prefix naming convention this did not happen. I guess one had decided much earlier it is not very convenient to type "container.zope_id" and the like. Actually most of the "internal" names not supposed for public usage are prefixed with an underscore, thus You are already protected from a lot of things. Changing the current approach is also not an option due to backwards compatibility problems. I guess it would help You out of Your frustration if You would get a list of the "reserved" method names? (I have never tried to find out the "reserved" names (e.g. the python attributes of an object); this could be possible via an ExternalMethod hack using the python "dir" build-in, I guess. For names of acquired attributes I have no good idea, either). About the name clash issue with the SQL data fields: You could do pretty the same the Formulator does: prefix every field id with a fixed string which guarantees there are no naming conflicts. (E.g. "manage_" may be a bad option ;) "field_" should do nicely.) This is quite the opposite to the approach You propose, but it has the advantage it can doe in practice ... regards, clemens
Skip Montanaro writes:
>> It clearly isn't in use in this folder. Is this some kind of reserved >> word in Zope?
Jamie> yes
Is there some way to discover what these reserved names are, or do people have to just stumble upon them?
The answer "it is reserved" was not very good: An object manager refuses to add a given name when it already has an attribute with this name. In the case of "manage", he does not have it itself but gets it from its class. Thus, when you have an object, all its attributes, either instance or class, either members or methods, are reserved. As you see, the list of reserved names is object and state dependent... "DocFinder" may help you to find the class attributes. See <http://www.dieter.handshake.de/pyprojects/zope> Dieter
Ben Avery wrote:
When I try to add the folder, I am told that this is a bad request, because the id 'manage' is already in use.
It clearly isn't in use in this folder. Is this some kind of reserved word in Zope?
So you're doing this in the management interface, right? Check out the funny bit at the end of the URL ;-) cheers, Chris
participants (6)
-
Ben Avery -
Chris Withers -
Clemens Robbenhaar -
Dieter Maurer -
Jamie Heilman -
Skip Montanaro