Re: [Zope] GUF and manage_addGenericUserFolder not working
--- Chris Withers <chrisw@nipltd.com> wrote:
Jason Byron wrote:
I try to call the function manage_addGenericUserFolder in a DTML Method but I keep getting a NameError for it. It's as if Zope can't find the definition.
Try somethign like the following:
<dtml-with "manage_addProduct['GenericUserFolder']"> <dtml-call "manage_addGenericUserFolder(your, params, here)"> </dtml-with>
cheers,
Chris
Hey, that worked! Thanks Chris Now, *why* does that work? The function manage_addProduct looks like its for adding new products under the Control_Panel. That isn't what it's for? I don't have to do <dtml-with "manage_addProduct['OFSP']"> to use manage_addUserFolder ? I noticed this in the OFSP stuff. from :lib/python/Products/OFSP/__init__.py line :153 context.registerClass( AccessControl.User.UserFolder, constructors=(AccessControl.User.manage_addUserFolder,), icon='images/UserFolder_icon.gif', legacy=(AccessControl.User.manage_addUserFolder,), ) context.registerBaseClass(AccessControl.User.UserFolder, 'User Folder') context.registerBaseClass(AccessControl.User.User) Could adding something like this to the GUF fix the problem I had and let manage_addGenericUserFolder work by itself? Jason __________________________________________________ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/
On Wed, 30 Aug 2000, Jason Byron wrote:
Now, *why* does that work? The function manage_addProduct looks like its for adding new products under the Control_Panel. That isn't what it's for?
I don't have to do <dtml-with "manage_addProduct['OFSP']"> to use manage_addUserFolder ?
[...]
legacy=(AccessControl.User.manage_addUserFolder,),
I think the key word here is 'legacy'. I think this was the original method of adding object instances for all products, but some bright spark realized that as more products are added this flat name space gets more and more bloated and name collisions become much more likely.
Could adding something like this to the GUF fix the problem I had and let manage_addGenericUserFolder work by itself?
It should work if you really like it that way. -- Stuart Bishop Work: zen@cs.rmit.edu.au Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au Computer Science, RMIT University
Jason Byron wrote:
Now, *why* does that work? The function manage_addProduct looks like its for adding new products under the Control_Panel. That isn't what it's for?
Nope, that dtml-with pops the namespace of the product you want to add onto the stack. In essence, it gives you access to the methods of that product where they wouldn't normally be accessible...
I don't have to do <dtml-with "manage_addProduct['OFSP']"> to use manage_addUserFolder ?
That's 'cos someone thought it'd be a good idea to make a shortcut, ignoring the fact that it'd confuse the hell out of us mere mortals ;-)
Could adding something like this to the GUF fix the problem I had and let manage_addGenericUserFolder work by itself?
That would Be Bad (tm) cheers, Chris
participants (3)
-
Chris Withers -
Jason Byron -
Stuart Bishop