Re: [Zope] HEELLPP - Please !!!
I think this line: where users.user_login=dtml-sqlvar name=login type=string Should be: where users.user_login=dtml-sqlvar login type=string --- no name= DR Hi, I have the following ZSQL-Method: arguments : login - select user_passwd as real_password from users where users.user_login=dtml-sqlvar name=login type=string when I now press "change and test" and insert a valid login into the Login-field I get: Error, Missing Input: Missing input variable, login The database works just fine as do other ZSQL-Methods ... Thanks, Mario ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] .dtml files
I've been digging into to the inner workings of Zope trying to gleen as much Zen as possible, before I implement a write of our existing framework. During this process I have noticed that Zope's dtml pages are stored on the file system as .dtml files (i.e. roleEdit.dtml) The question then is how does Zope display this pages?? I have found function calls such as: manage_roleForm=HTMLFile('roleEdit', globals()) which I believe creates an HTML document template from the named file. But, what is the mechanism that calls/displays mange_roleForm? Thanks in advance, DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope-killer: zSQL method that crashes Zope
If it matters to anyone, Andy isn't the only one with Zope killing ZSQL Methods I just spent way too much time trying to figure out why our stage enviroment was crashing. Turns out to be a ZSQL method which fails. Of course it wasn't wrapped in a try/except . Oh well, so much for standards...! DR Andy Gates wrote: Here's a thing. Those problems I was having with some sort of Zope-killing page have been tracked down to a particular zSQL method. The zSQL method is duff, in that is should fail - the perils of late-night coding on decaf, I fear - but it should fail neatly with a Zope error, not crash out the Python interpreter and force some poor schmuck to restart the limping Zope process. I don't know whether this is a peculiarity to my setup (NT4SP6, IIS4, Zope2, Access97 database) or a general problem; perhaps some of the developer-hatted Zopistas could take a look? The poison SQL is this: select (dtml-var field, field2) from tablename where (field1= dtml-sqlvar parameter1 type=string and dtml-var field '') Where two parameters are passed to the method, namely "field" and "parameter1". parameter1 is fed in as a dtml-sqlvar and searches against the table's field1 column. field is passed in as a dtml-var and is used to define which of the table's other fields is retruned. field2 is always returned. What makes the SQL duff is the parentheses around the fields in the first part of the SELECT. They're not required and if you remove them to produce the zSQL below, it works fine. select dtml-var field, field2 from tablename where (field1= dtml-sqlvar parameter1 type=string and dtml-var field ' So why does it kill Python? I'm only vaguely concerned now that I've found the fault, because of course the SQL is canned and no developer could get their hands on it - but this experience redoubles my acceptance of the notion of canned SQL! AndyG "I don't suffer from stress. I'm just a carrier." ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] zope 2.2.0 simply dies
Make sure that ALL your dtml-in's are wrapped in try/excepts we have seen this happened when there is a problem with either the sql or database adaptor. DR Andy Pahne wrote: I have a Zope-2.2.0 installation running on a Redhat 6.0 Linux Box. It simply dies sometimes. Three times in the last 72 hours?!? There's only DCOracle and ZOracleDA installed, nothing more. I cannot see any other problems on the machine and it does not have that much load. Is there a solution? Has anybody had the same problem? Andy Pahne [EMAIL PROTECTED] net22 GmbH Bad Meinberger Strasse 1 32760 Detmold Tel.: 05231 - 580 640 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] while
Try: dtml-in "_.range(1,10)" dtml-var sequence-item /dtml-in "Leichtman, David J" wrote: Is there an easy way to simulate the functionality of a while loop in DTML? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Product question
Not to sound like a completely blithering idiot, but how does one go about setting the permissions to allow it to be created. I'd assume in the __ac_permissions class attribute. What the specific permission is escapes me. DR Andy McKay wrote: Make sure you have the permissions set correctly for that product, so that you are allowed to create it. -- Andy McKay, Developer, ActiveState http://www.ActiveState.com Programming for the People - Original Message - From: "Daniel Rusch" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 15, 2000 9:11 AM Subject: [Zope] Product question I've created a product, installed it and it appears on the Product Management at /Control_Panel / Products list. The question is how do I get it to appear in the drop down of Available Objects? Dan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Another Product question
Thanks, I had made a small misspelling which did not generate any errors but which hosed the Product. New problem, My product appears on the Product Management at /Control_Panel / Products page and in the drop down of Available Objects. I select my Product from the drop down and I get my add product page. But when i fill out the page and click add, I get the following error message: Zope Error Zope has encountered an error while publishing this resource. Debugging Notice Zope has encountered a problem publishing your object. Missing doc string at: http://hal9000:8080/manage_addProduct/FrameWorkDoc/manage_addFrameWorkDoc Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File /home/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/Zope-2.1.6-linux2-x86/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook File /home/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, line 151, in publish File /home/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/BaseRequest.py, line 348, in traverse File /home/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/HTTPResponse.py, line 521, in debugError NotFound: (see above) Any thoughts ??? Dan Loren Stafford wrote: From: "Daniel Rusch" [EMAIL PROTECTED] I've created a product, installed it and it appears on the Product Management at /Control_Panel / Products list. The question is how do I get it to appear in the drop down of Available Objects? You have to register the class it defines. If you want the class to be subclassable by ZClasses, you also have to registerBaseClass. Here's an example copied from the __init__.py of my Xron product: context.registerClass( XronDTMLMethod.XronDTMLMethod, permission = 'Add Scheduled Method', constructors = ( XronDTMLMethod.manage_addXronDTMLMethodForm, XronDTMLMethod.manage_addXronDTMLMethod), icon = 'www/Event.gif') context.registerBaseClass(XronDTMLMethod.XronDTMLMethod) context.registerHelp() -- HTH -- Loren ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Creating properties with a product.
Take a look at the doc string in the class definition of PropertyManager. It states that: An object may specify that it has one or more predefined properties, by specifying an _properties structure in its class:: _properties=({'id':'title', 'type': 'string', 'mode': 'w'}, {'id':'color', 'type': 'string', 'mode': 'w'}, ) The _properties structure is a sequence of dictionaries, where each dictionary represents a predefined property. Note that if a predefined property is defined in the _properties structure, you must provide an attribute with that name in your class or instance that contains the default value of the predefined property. Also take a look at some of the other products out there that have properties and you will see how they handle them. Don't forget to update any properties you have added in your manage_edit member function for example: self._updateProperty('cool',cool) Hope this helps, DR jesse wrote: Hello, I recently created a product which adds a folder, with multiple dtmldocuments inside of it, effectivly creating a site immedatly. However, even though I can add folders and documents easiliy, I can't seem to create properties! It keeps giving me the Attribute error: aq_base. Here is the code for the function that does the work: def manage_addMemberSite(self, id, title='',REQUEST=None): """Add a MemberSite folder.""" try: user=REQUEST['AUTHENTICATED_USER'] except: user=None folder = MemberSite(id, title) # _setObject must be the Zope hook that actually stores this instance in # the ZODB self._setObject(id, folder) folder.manage_addFolder(id='Images', title='') folder.manage_addDTMLDocument(id='index_html', title='', file=index_body) folder.manage_addDTMLDocument(id='navbar', title='', file=navbar_html) folder.manage_addDTMLDocument(id='content', title='enter page content here', file=default_dd_html) folder.manage_addProperty(id='nav_color', value='#483D8B', type='string') folder.manage_addProperty(id='content_color', value='#F0E68C', type='string') folder.manage_addProperty(id='background_color', value='#FF', type='string') if REQUEST: return self.manage_main(self, REQUEST, update_menu=1) The folder.manage_addProperty(id etc etc) does not work. I have been looking all over, have looked to where the error seems to stem from, (the valid_property_id function in the PropertyManager.py) but I can't seem to find out whats wrong. Does anyone have any ideas? Please respond ASAP. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] The mysteries of Product icons ?????
I made an icon form my new product, Zope loaded it correctly. Then someone had the brilliant idea to change it. I can not figure out how to get Zope to load the new icon. I have deleted the product from Product Management at /Control_Panel / Products, rm the *.pyc files, bounced Zope, but it still hangs on to the old icon. Can anyone out there demystify this for me??? DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to assing a string value to a variable in DTML?
dtml-let a="'a'" b="'b'" dtml-var "a+b" /dtml-let Notice the quotes. See the How to on Let tags: http://www.zope.org/Members/michel/HowTos/LetTagHow-To DR "iap_y2fun.com" wrote: Forgive me for this stupid question: How to assing a string value to a variable in DTML? for example: dtml-let a='a' b='b' dtml-var "a+b" /dtml-let it causes error, not what I expected: given a="", b="", and eval a+b to "" Thanks iap ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Product inhetitance question
Hey all, Say I have a fully functional (and more importantly, working) Product will call A. I want to extend this Product's capabilities so I wish to derive another class from it, call it B. No problem, class B(A): . The question is, (I think the answer is no) is there a way to inherit (i.e. reuse common code and extend it) the manage_Add function and the dtml files from A??? Thanks, DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] getting base classes's (super class) _properties tuple
Say I have a fully functional (and more importantly, working) Product will call A. I want to extend this Product's capabilities so I wish to derive another class from it, call it B. No problem, class B(A): . now in class B I want to add a new property. Is the a way of getting the base (super) class _properties tuple and just adding the new one to it. Since a tuple is an immutable object I can't do this: _properties=A._properties.append({'id':'RenderStandardHeader', 'type':'int','mode':'w'}) Any thoughts DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Product inhetitance question
This worked for me, what a hack _ properties=[] for i in range(0,len(A._properties)): _properties.append(A._properties[i]) _properties.append({'id':'RenderStandardHeader', 'type':'int','mode':'w'}) tuple(_properties) Andy McKay wrote: Hmm i just tested it in Zope and it worked fine for me. -- Andy McKay, Developer, ActiveState http://www.ActiveState.com Programming for the People - Original Message - From: "Daniel Rusch" [EMAIL PROTECTED] To: "Andy McKay" [EMAIL PROTECTED] Sent: Thursday, August 17, 2000 11:36 AM Subject: Re: [Zope] Product inhetitance question Great minds think a like or fools never differ. I tried this to but I get an error: TypeError: bad operand type(s) for + Dan Andy McKay wrote: I just had the exact same problem and I solved this morning by: class A: _properties = ( {...} ) class B(A): _properties = ( { new stuff... } ) _properties = _properties + A._properties This is tested in a quick script, but not fully in the products yet. So this will make class B have a properties dict that includes all of A, so you shouldnt need to edit manage_edit... in theory! -- Andy McKay, Developer, ActiveState http://www.ActiveState.com Programming for the People - Original Message ----- From: "Daniel Rusch" [EMAIL PROTECTED] To: "Andy McKay" [EMAIL PROTECTED] Sent: Thursday, August 17, 2000 9:40 AM Subject: Re: [Zope] Product inhetitance question Sorry to keep bothering you, but I'm on the threshold of success my B class has an extra property, therefore B's manage_edit needs to address this. In C++ I could override the base class's manage_edit do the B stuff and then call the base class's manage_edit, can this be done in python??? Dan Andy McKay wrote: Well by inheritance B has all the methods, properties etc you have in A. So the answer is yes, if A has the foobar method then B will have a foobar method. Or do I misunderstand your question? -- Andy McKay, Developer, ActiveState http://www.ActiveState.com Programming for the People - Original Message - From: "Daniel Rusch" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 17, 2000 8:42 AM Subject: [Zope] Product inhetitance question Hey all, Say I have a fully functional (and more importantly, working) Product will call A. I want to extend this Product's capabilities so I wish to derive another class from it, call it B. No problem, class B(A): . The question is, (I think the answer is no) is there a way to inherit (i.e. reuse common code and extend it) the manage_Add function and the dtml files from A??? Thanks, DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] getting base classes's (super class) _properties tuple
I can't believe it, but I didn't have the last comma ({'b':'B', 'bb':'BB'}, ) and that's what was killing me .agh BTW, I noticed you are using lists of dictionaries instead of the "standard" tuple of dictionaries. I don't know if there are any consequences to doing this. Anyway, since yours are lists you should be able to to do this: class A: _properties = [ {'a':'A', 'aa':'AA'}, ] class B(A): _properties = [ {'b':'B', 'bb':'BB'}, ] _properties.append(A._properties) not that it realy matters. Thanks, Dan Andy McKay wrote: class A: _properties = [ {'a':'A', 'aa':'AA'}, ] class B(A): _properties = [ {'b':'B', 'bb':'BB'}, ] _properties = _properties + A._properties b = B() print b._properties Works for me. -- Andy McKay, Developer, ActiveState http://www.ActiveState.com Programming for the People - Original Message - From: "Daniel Rusch" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 17, 2000 11:30 AM Subject: [Zope] getting base classes's (super class) _properties tuple Say I have a fully functional (and more importantly, working) Product will call A. I want to extend this Product's capabilities so I wish to derive another class from it, call it B. No problem, class B(A): . now in class B I want to add a new property. Is the a way of getting the base (super) class _properties tuple and just adding the new one to it. Since a tuple is an immutable object I can't do this: _properties=A._properties.append({'id':'RenderStandardHeader', 'type':'int','mode':'w'}) Any thoughts DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Creating an object from within another
So far so good, Next hurdle, at least the problems have been cut down to hurdles from walls. I have a folderish product say myFolder, in the manage_addMyFolder function I want to create an object of my product B. so I do this: def manage_addmyFolder(self, id, title='', REQUEST=None): """Add a new myFolder object with id *id*. """ ob=myFolder() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None ob.manage_addB(id='index_html', title='') -- if I change this to ob.manage_addDTMLDocument(id='index_html', title='') that works ? ... I get the following error: AttributeError: manage_addB Any thoughts, DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Creating an object from within another
Yeah, that's what i thought, but I know it exists cause I can create an object of type B and I copied and pasted the manage_addB part? For any one else who is reading this: the problem is: I have a product I'll call B. Additionally I have a folderish product I'll call myFolder. What I want to do is when I create a folderish object (a myFolder) in it I want an object B, very similar to when a folder is created you can have a DTMLMethod created. And here is the rub, I am able to have my folderish object create a DTMLMethod instead of an object B. Any thoughts, Dan Andy McKay wrote: Not to sure there Im afraid. The obvious answer is the manage_addB doesnt exist whereas manage_addDTMLDocument does. -- Andy McKay, Developer, ActiveState http://www.ActiveState.com Programming for the People - Original Message - From: "Daniel Rusch" [EMAIL PROTECTED] To: "Daniel Rusch" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, August 17, 2000 1:39 PM Subject: [Zope] Creating an object from within another So far so good, Next hurdle, at least the problems have been cut down to hurdles from walls. I have a folderish product say myFolder, in the manage_addMyFolder function I want to create an object of my product B. so I do this: def manage_addmyFolder(self, id, title='', REQUEST=None): """Add a new myFolder object with id *id*. """ ob=myFolder() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None ob.manage_addB(id='index_html', title='') -- if I change this to ob.manage_addDTMLDocument(id='index_html', title='') that works ? ... I get the following error: AttributeError: manage_addB Any thoughts, DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Product question, third posting
I've created a folderish product. When I select that product from the available objects list, thus creating an instance of that product, I can create objects like dtml document and dtml method in the new folderish object (very similar to what happens when you instantiate a folder object, you can have a dtml method created in the new folder). The question is why can't I create objects from the Products directory, such as Local File System? The code below works great, I get a dtml document, two folders each with a dtml method in them HOW CAN I CREATE A LOCAL FILE SYSTEM OR ANY OTHER OBJECT FROM THE PRODUCTS DIRECTORY IN THIS MANAGE_ADD FUNCTION??? def manage_addSimpleSite(self, id, title='', createNewFolder=0, createEditFolder=0, REQUEST=None): """Add a new SimpleSite object with id *id*. If the 'createNewFolder' and 'createEditFolder' parameters are set to any true value, an 'New sub Folder' and an 'edit sub Folder' objects are created respectively in the new SimpleSite. """ ob=SimpleSite() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None ob.manage_addDTMLDocument(id='index_html', title='') if createNewFolder: if (user is not None) and not ( user.has_permission('Add User SimpleSites', self)): raise 'Unauthorized', ( 'You are not authorized to add User SimpleSites.' ) ob.manage_addFolder(id='New'+id, title='', createPublic=1) if createEditFolder: if (user is not None) and not ( user.has_permission('Add Documents, Images, and Files', self)): raise 'Unauthorized', ( 'You are not authorized to add DTML Documents.' ) ob.manage_addFolder(id='Edit'+id, title='', createPublic=1) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1) Thanks, Dan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Fourth Posting, is this really that difficult or have I been blackballed :)balled :)
I've created a folderish product. When I select that product from the available objects list, thus creating an instance of that product, I can create objects like dtml document and dtml method in the new folderish object (very similar to what happens when you instantiate a folder object, you can have a dtml method created in the new folder). The question is why can't I create objects from the Products directory, such as Local File System? The code below works great, I get a dtml document, two folders each with a dtml method in them HOW CAN I CREATE A LOCAL FILE SYSTEM OR ANY OTHER OBJECT FROM THE PRODUCTS DIRECTORY IN THIS MANAGE_ADD FUNCTION??? def manage_addSimpleSite(self, id, title='', createNewFolder=0, createEditFolder=0, REQUEST=None): """Add a new SimpleSite object with id *id*. If the 'createNewFolder' and 'createEditFolder' parameters are set to any true value, an 'New sub Folder' and an 'edit sub Folder' objects are created respectively in the new SimpleSite. """ ob=SimpleSite() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None ob.manage_addDTMLDocument(id='index_html', title='') if createNewFolder: if (user is not None) and not ( user.has_permission('Add User SimpleSites', self)): raise 'Unauthorized', ( 'You are not authorized to add User SimpleSites.' ) ob.manage_addFolder(id='New'+id, title='', createPublic=1) if createEditFolder: if (user is not None) and not ( user.has_permission('Add Documents, Images, and Files', self)): raise 'Unauthorized', ( 'You are not authorized to add DTML Documents.' ) ob.manage_addFolder(id='Edit'+id, title='', createPublic=1) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1) Thanks, Dan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Creating an object from within another
Thanks for the help gentlemen, but I still get the same error mesage: Zope Error Zope has encountered an error while publishing this resource. AttributeError Sorry, a Zope error occurred. Traceback (innermost last): File /home/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/Zope-2.1.6-linux2-x86/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook File /home/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, line 165, in publish File /home/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_addSimpleSite) File /home/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: manage_addSimpleSite) File /home/zope/lib/python/Products/SimpleSite/SimpleSite.py, line 72, in manage_addSimpleSite AttributeError: manage_addBasicDocument Any thoughts, DR Chris McDonough wrote: I think he meant ob.__of__(self) which wraps ob into the context of self. Useful for returning unwrapped Python objects while you're in Python. On Fri, 18 Aug 2000, Kapil Thangavelu wrote: Dieter Maurer wrote: Daniel Rusch writes: So far so good, Next hurdle, at least the problems have been cut down to hurdles from walls. I have a folderish product say myFolder, in the manage_addMyFolder function I want to create an object of my product B. so I do this: def manage_addmyFolder(self, id, title='', REQUEST=None): """Add a new myFolder object with id *id*. """ ob=myFolder() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None ob.manage_addB(id='index_html', title='') -- if I change this to Try: (ob __of__ self).manage_addB() whats is ob__of__self ??? acquisition at its best? attribute access to get a reference to the ob attr of self? kapil ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Fourth Posting, is this really that difficult or have I been blackballed :)balled :)
not sure what you mean by "subobject adding in your __init__ method" Dan Kapil Thangavelu wrote: btw daniel, i've looked at some your postings for the day and i thought i should tell you that most of your problems would go away if you did subobject adding in your __init__ method within your class or in the hook method manage_afterAdd within your class. for future reference. You'd get all the benefits of inheritance. Let manage_add to do just that, instantiate and set a instance of your class. Kapil Kapil Thangavelu wrote: Daniel wrote I've created a folderish product. When I select that product from the available objects list, thus creating an instance of that product, I can create objects like dtml document and dtml method in the new folderish object (very similar to what happens when you instantiate a folder object, you can have a dtml method created in the new folder). The question is why can't I create objects from the Products directory, such as Local File System? The code below works great, I get a dtml document, two folders each with a dtml method in them HOW CAN I CREATE A LOCAL FILE SYSTEM OR ANY OTHER OBJECT FROM THE PRODUCTS DIRECTORY IN THIS MANAGE_ADD FUNCTION??? def manage_addSimpleSite(self, id, title='', createNewFolder=0, createEditFolder=0, REQUEST=None): """Add a new SimpleSite object with id *id*. If the 'createNewFolder' and 'createEditFolder' parameters are set to any true value, an 'New sub Folder' and an 'edit sub Folder' objects are created respectively in the new SimpleSite. """ ob=SimpleSite() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None ob.manage_addDTMLDocument(id='index_html', title='') if createNewFolder: if (user is not None) and not ( user.has_permission('Add User SimpleSites', self)): raise 'Unauthorized', ( 'You are not authorized to add User SimpleSites.' ) ob.manage_addFolder(id='New'+id, title='', createPublic=1) if createEditFolder: if (user is not None) and not ( user.has_permission('Add Documents, Images, and Files', self)): raise 'Unauthorized', ( 'You are not authorized to add DTML Documents.' ) ob.manage_addFolder(id='Edit'+id, title='', createPublic=1) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1) a couple of things. A. you're not being blackballed. when you're posting to the list its hard to help without specifics. you're posting above, would be better with a traceback of code that does attempt to instantiate a product. which leads to B. how are you attempting to instantiate your other products. example code of what you're trying to do would be helpful. are you doing it the same as adding folders like above... i have no idea... C. seems like you're doing this in python. the code below should work fine. from Products import LocalFS in manage_add: id = 'foo' ob2 = LocalFS.LocalFS(id) # check the exact calls to __init__ in LocalFS id2 = 'foo2' ob = yourproduct(id2) ob._setObject(id , ob2) in __init__ or manage_afterAdd id ='foo' ob = LocalFS.LocalFS(id) self._setObject(id, ob) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] I'm really confused: Creating an object from within another
I really appreciate the help I've been getting, but I'm really confused as to why I can create a DTMLMethod or DTMLDocument, but not any product from the products directory. Granted I don't have many installed, but whats the difference between a Product that lives in the OFS directory and a Product that lives in the Product directory, and why can't I create them the same Dan Chris McDonough wrote: I think he meant ob.__of__(self) which wraps ob into the context of self. Useful for returning unwrapped Python objects while you're in Python. On Fri, 18 Aug 2000, Kapil Thangavelu wrote: Dieter Maurer wrote: Daniel Rusch writes: So far so good, Next hurdle, at least the problems have been cut down to hurdles from walls. I have a folderish product say myFolder, in the manage_addMyFolder function I want to create an object of my product B. so I do this: def manage_addmyFolder(self, id, title='', REQUEST=None): """Add a new myFolder object with id *id*. """ ob=myFolder() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None ob.manage_addB(id='index_html', title='') -- if I change this to Try: (ob __of__ self).manage_addB() whats is ob__of__self ??? acquisition at its best? attribute access to get a reference to the ob attr of self? kapil ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] I think I'm close, but still no luck
Hello, (See bottom of this message for all the iterations I have tried) I've created a product called BasicDocument. I've installed it and it works great. I've also created a folderish product (called SimpleSite). When a user selects the SimpleSite product from the available objects list, thus creating an instance of that product, they have an option to create sub folders which contain objects like dtml documents, dtml methods, and my BasicDocument product (very similar to what happens when you instantiate a folder object, you can have a dtml method created in the new folder). I am able to have the manage_addSimpleSite function create DTMLDocument, DTMLMethod and Folder objects but I am unable to have the function create BasicDocuments (which live in the Products directory) additionally, I am unable to it create any Products from the Products directory, such as Local File System? The code below works great, I get a dtml document, two folders each with a dtml method in them HOW CAN I CREATE A BascicDocument, LOCAL FILE SYSTEM OR ANY OTHER OBJECT FROM THE PRODUCTS DIRECTORY IN THIS MANAGE_ADD FUNCTION??? Thanks, Dan def manage_addSimpleSite(self, id, title='', createNewFolder=0, createEditFolder=0, REQUEST=None): """Add a new SimpleSite object with id *id*. If the 'createNewFolder' and 'createEditFolder' parameters are set to any true value, an 'New sub Folder' and an 'edit sub Folder' objects are created respectively in the new SimpleSite. """ ob=SimpleSite() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None #ob.manage_addBasicDocument(id='index_html', title='')-- This line generates: AttributeError: manage_addBasicDocument ob.manage_addDTMLDocument(id='index_html', title='') if createNewFolder: if (user is not None) and not ( user.has_permission('Add User SimpleSites', self)): raise 'Unauthorized', ( 'You are not authorized to add User SimpleSites.' ) ob.manage_addFolder(id='New'+id, title='', createPublic=1) if createEditFolder: if (user is not None) and not ( user.has_permission('Add Documents, Images, and Files', self)): raise 'Unauthorized', ( 'You are not authorized to add DTML Documents.' ) ob.manage_addFolder(id='Edit'+id, title='', createPublic=1) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1 I have tried the following each generated an error: 1. ob.manage_addBasicDocument(id='index_html', title='') AttributeError: manage_addBasicDocument 2. ob.manage_addProduct['SimpleSite'].manage_addBasicDocument(id='index_html', title='') AttributeError: _getProducts 3. self.manage_addProduct['SimpleSite'].manage_addBasicDocument(id='index_html', title='')AttributeError:manage_addBasicDocument 4. self.manage_addProduct['BasicDocument'].manage_addBasicDocument(id='index_html', title='') TypeError: not enough arguments; expected 2, got 0 5. ob.manage_addProduct['BasicDocument'].manage_addBasicDocument(id='index_html', title='')AttributeError: _getProducts ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] What does context.registerBaseClass() do ???
I have searched the FM's and I cannot find anything on context.registerBaseClass(). Can anyone explain what this does for me and what the syntax of the argument list should be? Thanks, Dan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] It Works!!!! I think I'm close, Product Creation and other threads
Great news, I did it...! The trick seems to be adding the legacy line to the BasicDocument __init__.py file (see below). This allowed the following line to work in the folderish (SimpleSite) product's manage_addSimpleSite function to quit barfing: ob.manage_addBasicDocument(id='index_html', title='') BTW, Remember I said that I my plan of attach, while I was praying for an epiphany, was to figure out how a Folder could create sub products. Well, I figured this out via an epiphany, I accidentally cd'd to OFSP instead of OFS and I looked at the __init__.py file, it was most illuminating. Ok it wasn't exactly an epiphany, but I'll still chalk it up to divine intervention DR This is the __init__.py file for the folderish product which contains the other product I created. __doc__="""SimpleSite product initialization""" __version__='$Revision: 0.1 $'[11:-2] try: import os, SimpleSite from Globals import ImageFile def initialize(context): context.registerClass( SimpleSite.SimpleSite, constructors=(SimpleSite.manage_addSimpleSiteForm, SimpleSite.manage_addSimpleSite), #icon='simpleSite.gif', legacy=(SimpleSite.manage_addSimpleSite,), ) context.registerBaseClass(SimpleSite.SimpleSite, 'Simple Site') except: print "She's sucking mud in SimpleSite land capt'n:" import traceback traceback.print_exc() This is the __init__.py file for the other product: __doc__="""BasicDocument product initialization""" __version__='$Revision: 0.1 $'[11:-2] try: import os, BasicDocument from Globals import ImageFile def initialize(context): context.registerClass( BasicDocument.BasicDocument, constructors=(BasicDocument.manage_addBasicDocumentForm, BasicDocument.manage_addBasicDocument), #icon='basicDoc.gif', legacy=(BasicDocument.manage_addBasicDocument,), ) context.registerBaseClass(BasicDocument.BasicDocument, 'Basic Document') except: print "She's sucking mud in BasicDocument land capt'n:" import traceback traceback.print_exc() Chris Beaumont wrote: Daniel, Would you let me know if you get a good answer to your question.. I'm trying to do something quite similar.. Thank you. Chris Daniel Rusch wrote: Hello, (See bottom of this message for all the iterations I have tried) I've created a product called BasicDocument. I've installed it and it works great. I've also created a folderish product (called SimpleSite). When a user selects the SimpleSite product from the available objects list, thus creating an instance of that product, they have an option to create sub folders which contain objects like dtml documents, dtml methods, and my BasicDocument product (very similar to what happens when you instantiate a folder object, you can have a dtml method created in the new folder). I am able to have the manage_addSimpleSite function create DTMLDocument, DTMLMethod and Folder objects but I am unable to have the function create BasicDocuments (which live in the Products directory) additionally, I am unable to it create any Products from the Products directory, such as Local File System? The code below works great, I get a dtml document, two folders each with a dtml method in them HOW CAN I CREATE A BascicDocument, LOCAL FILE SYSTEM OR ANY OTHER OBJECT FROM THE PRODUCTS DIRECTORY IN THIS MANAGE_ADD FUNCTION??? Thanks, Dan def manage_addSimpleSite(self, id, title='', createNewFolder=0, createEditFolder=0, REQUEST=None): """Add a new SimpleSite object with id *id*. If the 'createNewFolder' and 'createEditFolder' parameters are set to any true value, an 'New sub Folder' and an 'edit sub Folder' objects are created respectively in the new SimpleSite. """ ob=SimpleSite() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None #ob.manage_addBasicDocument(id='index_html', title='')-- This line generates: AttributeError: manage_addBasicDocument ob.manage_addDTMLDocument(id='index_html', title='') if createNewFolder: if (user is not None) and not ( user.has_permission('Add User SimpleSites', self)): raise 'Unauthorized', ( 'You are not authorized to add User SimpleSites.' ) ob.manage_addFolder(id='New'+id, title='', createPublic=1) if createEditFolder: if (user is not None) an
[Zope] Sub Class Question
I've created a BasicMethod which is derived from the DTMLMethod. everything works great until I try to have the sub class's (BasicMethod) __call__ method call the super class's (DTMLMethod) __call__ method. class BasicMethod(DTMLMethod): """BasicMethod objects are DocumentTemplate.HTML objects that act as methods whose 'self' is the BasicMethod itself.""" meta_type='Basic Method' def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw): print 'Sub Class __call__' DTMLMethod.__call__(self, client, REQUEST, RESPONSE, kw) Globals.default__class_init__(BasicMethod) when I view the BasicMethod in Zope, I get: Error Type: TypeError Error Value: too many arguments; expected 4, got 5 I believe that I need the self arg, if I remove it I get an unbound python method error. Any thoughts??? DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Product creation question
I've created a product called BasicDocument. I've installed it and it works great. I've also created a folderish product. Installed. When a user selects that product from the available objects list, thus creating an instance of that product, they have an option to create sub folders which contain objects like dtml documents, dtml methods, and my BasicDocument product (very similar to what happens when you instantiate a folder object, you can have a dtml method created in the new folder). I am able to have the manage_addSimpleSite function to create DTMLDocument, DTMLMethod and Folder objects but I am unable to have the function create BasicDocuments (which live in the Products directory) additionally, I am unbale to it create any Products from the Products directory, such as Local File System? The code below works great, I get a dtml document, two folders each with a dtml method in them HOW CAN I CREATE A LOCAL FILE SYSTEM OR ANY OTHER OBJECT FROM THE PRODUCTS DIRECTORY IN THIS MANAGE_ADD FUNCTION??? ob.manage_addBasicDocument(id='index_html', title='') -- THISLINESGENERATESANERROR: AttributeError: manage_addBasicDocument ref the code below. Please reply all if you are responding from the dev list as I usually don't monitor the dev list. Thanks, Dan def manage_addSimpleSite(self, id, title='', createNewFolder=0, createEditFolder=0, REQUEST=None): """Add a new SimpleSite object with id *id*. If the 'createNewFolder' and 'createEditFolder' parameters are set to any true value, an 'New sub Folder' and an 'edit sub Folder' objects are created respectively in the new SimpleSite. """ ob=SimpleSite() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None ob.manage_addBasicDocument(id='index_html', title='') -- THISLINESGENERATESANERROR: AttributeError: manage_addBasicDocument ob.manage_addDTMLDocument(id='index_html', title='') if createNewFolder: if (user is not None) and not ( user.has_permission('Add User SimpleSites', self)): raise 'Unauthorized', ( 'You are not authorized to add User SimpleSites.' ) ob.manage_addFolder(id='New'+id, title='', createPublic=1) if createEditFolder: if (user is not None) and not ( user.has_permission('Add Documents, Images, and Files', self)): raise 'Unauthorized', ( 'You are not authorized to add DTML Documents.' ) ob.manage_addFolder(id='Edit'+id, title='', createPublic=1) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1
Re: [Zope] How to Pass values to a DTML method ??
dtml-var "some_method(param='Test')" 'Test' is single quoted if it is a string, if it is a variable then don't quote it. Notice also the double quotes "some_method(param='Test')" Dan Stuart Foster wrote: I have a DTML method that is called from a document. I need to pass a value to it like a parameter would be passed to a function. dtml-var some_method(param=value) Thanks ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to Pass values to a DTML method ??
They pass in the current name space, the context if you will. Someone posted a reply that had a link to the faq that attempts to explains this. DR Stuart Foster wrote: This is the way I had to do it what's up with the two extra params? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Dieter Maurer Sent: Monday, September 11, 2000 2:24 PM To: Stuart Foster Cc: Zope List Subject: Re: [Zope] How to Pass values to a DTML method ?? Stuart Foster writes: I have a DTML method that is called from a document. I need to pass a value to it like a parameter would be passed to a function. dtml-var some_method(param=value) That does not look too bad, but you forgot the "..." around the call. You should include two positional parameters as well: dtml-var "some_method(_.None,_,param=value)" Otherwise, you cut the namespace propagation. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Desperate Zope is crashing ....
Hey all, I have a major problem! Our Zope site is crashing every few hours. I've grep'ed the python processes and they are still running but I can't access any pages. It's very strange because it just started happening last thursday. Prior to that we had no problems. No changes were made to the site. I know that software just doesn't start to have problems that something must have changed but I can't identify anything. One thought is that the user community is hitting an area of the site that they haven't in the past, but how do i find it??? Details: Zope version: Zope 2.0.1 (source release, python 1.5.1, linux2) Python version: 1.5.2 (#6, Sep 22 1999, 10:32:58) [GCC 2.8.1] System Platform: sunos5 We have bounced the box, but still it dies??? I don't even know how to start debugging this ? I've crawled through the Z2.log file to no avail. DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML Loop, is there a 'continue'?
I hope there is a dtml-continue, I also have not been able to find it though. What I have done is resorted to an dtml-if (or some times an dtml-unless) that catches the condition I want to short circuit and wrapped the code in the dtml-else. The dtml-unless probably the better choice. dtml-in SomeLoop dtml-if "Something==SomethingElse" dtml-else The code that normally executes /dtml-if /dtml-in It ain't pretty but it works Dan "Spicklemire, Jerry" wrote: Hi Zope Fans, I'm about searched out trying to find any discussion about calling a normal "continue" statement, as in Python, from DTML. Any ideas? I just want to short circuit a dtml-in loop for one pass, and then finish the rest of the loop, based on a parameter. Thanks, Jerry S. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Detecting Roles not working
dtml-if "AUTHENTICATED_USER.has_role('Staff', this())" This works for me, no pun intended :) Dan Kapil Thangavelu wrote: Jonathan Cheyne wrote: Hi all I have built the basis of a site with full, form-based webediting of objects. Coming round to cleanup time and I wanted to remove certain visible functions from the default object views unless you have already logged in (with various possible roles) in the index_html of my zclass i have dtml-if "AUTHENTICATED_USER.has_role('Staff')" a href="dtml-var absolute_url/dtml-var typeedit"edit this/ahr /dtml-if so if the user is anonymous or logged in without the Staff role assigne they should not see the "edit this" link ... Doesn't work! It basically never returns a 'true' response thus never displays the edit this link even when logged in. try (untested) dtml-if "AUTHENTICATED_USER.has_role('Staff')==1" or (tested) dtml-if "'Staff' in AUTHENTICATED_USER.getRoles()" Cheers Kapil ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Subtracting DateTimes?????
We backup our database every night at 3:00 AM CT. 15 minutes prior to this (i.e. 2:45 AM) I would like to display a warning. How do I compare the current time dtml-var "(ZopeTime()).toZone('US/Central')" to 3:00 AM Central Time ? dtml-if "(ZopeTime()).toZone('US/Central') - 0.3" doesn't work. Any thoughts??? Dan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] pop back namespace from stack ?
In fact I need the id from the dtml-method I'm was called from Try dtml-var HTTP_REFERER Dan Beuserie Frédéric (stbrice dsi) wrote: hi, How can I pop back one namespace from the stack ?. In fact I need the id from the dtml-method I'm was called from. thanks a lot. - Beuserie Frederic DSI / Système et Exploitation - 3 Suisses Belgique Tel: +3269/882485 / Fax: +3269/882491 Email: [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Error List
Take a look at this http://www.python.org/doc/current/lib/module-exceptions.html Dan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] urgent
dtml-sendmail mailhost="MailHost" To:!--#var to -- From:!--#var from -- Subject: dtml-var subject dtml-mime type=text/plain encode=7bit !--#var comments-- dtml-boundary type="application/pdf; name=jsp-syntax.pdf" disposition="attachment; filename=EquipmentOrder.pdf" encode=base64dtml-in "PrintServiceOrder.PrintPdfs.fileValues(fileName)"dtml-var "_['sequence-item'].getObject()"/dtml-in/dtml-mime /dtml-sendmail PrintServiceOrder is a folder PrintPdfs is a localFileSystem Object Hope this helps Dan jacintha menezes wrote: hi, i am using zope(2.2.1) for sending mails, but it is not possible to send attachment. kindly let me know the reason have made use of mime to send attachment. thanks, jacintha ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Looking for short term Zope contractor
If you don't find the person(s) you are looking for, let me know. I am an experienced Zope/Python/SQL/HTML/JavaScript/Unix/Windows developer. Additionally, I have an excellent working relationship with two other developers with similar skills. Unfortunately, we are located in Wisconsin. Dan Robert Miller wrote: Hi, I'm looking for someone to work on a short (2-3 weeks long) Zope project. The details of the project are fairly straightforward; we have a relatively small database of information that is currently being injected into MySQL, and we'll need this database to be viewable/searchable from the web. The job is in San Francisco, and, while physical proximity is not absolutely necessary, preference will be given to those who are local. Interested parties should email a resume (text only, no attachments, please) to me at [EMAIL PROTECTED] Thanks for your time and attention, and we now return you to your regularly scheduled [EMAIL PROTECTED] mailing list traffic. -rob -- +--+ Rob Miller Director of Systems Engineering International Space Sciences Organization [EMAIL PROTECTED] +--+ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] redirect
dtml-call "RESPONSE.redirect('http://zope.org/index.htm?cod='+_.str(test))" You can't (and don't need to) put dtml tags inside dtml tags. Joaldo Junior wrote: how to for that function REDIRECT understand a variable. ex. dtml-call "RESPONSE.redirect('http://zope.org/index.htm?cod=dtml-var test')" ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] [Fwd: [Zope] Not grocking RESQUEST.set syntax]
Try: dtml-in MyFavoiteZSQLMethod dtml-call "REQUEST.set('filename', filename)" dtml-call some_other_thing_that_uses_filename /dtml-in This assumes that MyFavoiteZSQLMethod returns the variable filename Dan Noah wrote: I'm still not grocking the syntax for setting REQUEST fields. I want to set a REQUEST field "filename" to be the value returned by a ZSQL call. I want something like this (pseudo-code of what I want): dtml-let FOO=MyFavoiteZSQLMethod dtml-call "REQUEST.set('filename', FOO)" dtml-call some_other_thing_that_uses_filename /dtml-let That does not work because FOO gets set to something like: Shared.DC.ZRDB.Results.Results instance at 7760b0 I tried sticking this inside dtml-indtml-in to get at the sequence-item, but I just ended up getting confused. Yours, Noah ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: [Image-SIG] Properly integrating PIL, reportlab, and zope
I have no idea if this will help you. We use PIL, reportlabs and zope to create P.O.'s, to place a logo on the page we use the following line of code: c.drawInlineImage("gclogo_color.gif", .5*inch, 10.*inch,4*inch) where c is created thusly: c = canvas.Canvas(fileName,(PAGE_WIDTH*inch,PAGE_LENGTH*inch), pageCompression=0) HTH, Dan ed colmar wrote: Hi all! I am working on a project using zope and reportlab. The goal is to have uploaded images end up in a formatted PDF file. I have both of these halves completed, I need to figure out how to connect them. I have been using SquishFile.py as the wrapper around uploaded images, as is done in squishdot. The few image types I have tried have displayed fine on screen, but PIL is not able to recognise the image. How would you go about wrapping the file in a PIL.Image() ? I've been trying things similar to: cardimage=PIL.Image.open(self.uploadedimage) c.drawInlineImage(cardimage, 1,1) This gives an error in reportlab.canvas.convert() I tried using PIL.image.fromstring(), but I can't quite get the it to work out: filebytes=[str(self.uploadedimage.file_bytes()), 'bytes'] cardimage=PIL.Image.fromstring(self.uploadedimage.content_type(), filebytes, self.uploadedimage.file_data()) c.drawInlineImage(cardimage, 1,1) This gives a typeerror: PIL/Image.py, line 848, in new has anyone succesfully done this? can I just Leave the SquishFile wrapper off if it is ONLY going to be images that get uploaded? Thanks for any ideas! -ed- ___ Image-SIG maillist - [EMAIL PROTECTED] http://www.python.org/mailman/listinfo/image-sig ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Check for JavaScript:
Hey all, Is there a way from zope to check to see if a user has Javascript enabled Thanks, Dan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] images in directories
When you create your image object set the path correctly then your dtml-var image1 should work :) Dan CURTIS David wrote: Hi, I check the archives but could not find an answer. How do you display images that are burried in directories? For example, dtml-var image1 works with the image1 at same level but dtml-var /IMAGES/image1 does not. nor does dtml-var IMAGES/image1 Any help would be apprechiated. Thanks in advance ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Check for JavaScript:
Advice: client issues should be dealt with on client side. Great I agree completely, except if the client has Java/JavaScript turned off it is pretty darn difficult to have client issues dealt with on client side!! Dan Oleg Broytmann wrote: On Thu, 2 Nov 2000, Daniel Rusch wrote: Is there a way from zope to check to see if a user has Javascript enabled There is no. Advice: client issues should be dealt with on client side. Oleg. Oleg Broytmannhttp://phd.pp.ru/[EMAIL PROTECTED] Programmers don't die, they just GOSUB without RETURN. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] redirect on Authorization
Is there a way of having all users redirected upon Authorization? Let me explian. We have a very large site and many of Users bookmark pages. This can cause several problems especially if the site layout changes, security changes at different levels and a user bookmarks a result pages that depends on previous page(s) submissions. In other words can zope be hacked to return a preselected URL instead of the page the user has bookmarked? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: sending query output as an attachment
This is what we do dtml-sendmail mailhost="MailHost" To:dtml-var to From:dtml-var from Subject: dtml-var subject dtml-mime type=text/plain encode=7bit !--#var comments-- dtml-boundary type="application/pdf; name=jsp-syntax.pdf" disposition="attachment; filename=EquipmentOrder.pdf" encode=base64dtml-in "PrintServiceOrder.PrintPdfs.fileValues(fileName)"dtml-var "_['sequence-item'].getObject()"/dtml-in/dtml-mime /dtml-sendmail Dan jacintha menezes wrote: Hi, I am developing a product in which a output report (tabular form with data) is produced in result of a query. I have to send that report to different people through the mail facility available in zope as an attachment. So kindly guide me how can i send the output report as an attachment.If it can be through dtml tags or python module etc kindly write those methods for me. Waiting for your reply Thanks, Bye, jacintha ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Local Time Zone
Hey all, I know I can get the users language preference like this: dtml-var "REQUEST['HTTP_ACCEPT_LANGUAGE']" The question then is, is there a similar method of getting the users Local Time Zone??? Thanks, Dan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Sorting 'in'
If it's a database query sorting with sql first. i.e. ORDER BY X,Y HTH Dan Yvonne Totty wrote: Hi! I need a query sorted by 2-3 different attributes. The 'in' sort only lets me do it by one. Is there a way to get around it? TIA -y ~~~ Yvonne Totty Database Engineer - Wolverine: You actually go outside in these things? Cyclops: Well, what would you prefer? Yellow spandex? ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Search and replace
I have been following this thread with mild amusement. Those of you who don't think that there is any need for a search and replace are being, at the least, disingenuous. Have you never needed to replace a dtml var that is on a hundred or more pages with another one, but replace it only on some of the pages??? The lack of a search and replace, a find that actually "finds" a string on a page (instead of just the page) and other standard editor features are the reasons why Zope is being phased out of this companies (15,000 person worldwide company, the worlds largest web hosting and fiber optic network) web tool set. Don't get me wrong, I think Zope is the greatest thing since sliced bread. But, if Zope is to become anything other than a bastion for open source zealots (myself included), a real editor is a necessity not a nicety! Zope had the opportunity to sweep this company ( it could have ended up on hundreds if not thousands of servers) but the lack of a professional interface doomed it. DR Lee Hunter wrote: Martin Winkler wrote I just wanted to express that this feature may be too hard to program for the (IMHO) rare cases that we really need it, but IF there I had understood that Python and Zope excelled at string manipulation. That's why I am surprised that it would be difficult to scan a folder full of documents to find a word and replace it with another (with the option of ignoring anything in pointed brackets). I'm not a programmer so I probably don't appreciate the complexities of the task, however in this case it seems like the object-oriented database is a hindrance rather than a help. If it was just a batch of html files I could search and replace through them with just about any piece of software on my desktop. I wouldn't know whether this is the sort of tool that is generally useful, but in my work I use search and replace all the time (if only to fix my endless confusion over 'its' and 'it's') Cheers Lee Hunter Hum Communications Ltd. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to pass parameters to dtml methods in making dtml-call
I tried your code and it works fine both ways for me, are you sure that para exists in the second scenario. DR Dirksen wrote: Hi, The case is like this: dtml-var "some_dtml_method(_.None, _, para='blablabla')" Works fine. dtml-call "some_dtml_method(_.None, _, para='blablabla')" The system complains the para being unknown. How come? cheers Dirksen __ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Urgent Help, raise CorruptedTransactionError, message
When I try to start zope I get the following error. root@capsprodt1:/home/caps/test/zope$ Traceback (innermost last): File "/home/caps/test/zope/z2.py", line 386, in ? exec "import "+MODULE in {} File "string", line 1, in ? File "/home/caps/test/zope/lib/python/Zope/__init__.py", line 109, in ? DB=ZODB.FileStorage.FileStorage(Globals.BobobaseName) File "/home/caps/test/zope/lib/python/ZODB/FileStorage.py", line 287, in __init__ self._pos, self._oid, tid = read_index( File "/home/caps/test/zope/lib/python/ZODB/FileStorage.py", line 1165, in read_index panic('%s has invalid transaction header at %s', name, pos) File "/home/caps/test/zope/lib/python/ZODB/FileStorage.py", line 214, in panic raise CorruptedTransactionError, message ZODB.FileStorage.CorruptedTransactionError: /home/caps/test/zope/var/Data.fs has invalid transaction header at 31404268 Any ideas Dan ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] How to prevent the user from going Back to a page???
All, Has anyone figured out a way to prevent a user from going "Back" to a page once they have passed it. The situation: We have an Order Entry/Billing intranet site where users fill out several pages of data an then submit the information. After the order is submitted we would like to prevent them from backing up and resubmitting the same order. Is there a way to prevent them from doing this. I know I can remove the tool bar, but then the user can right click and select "Back" or select GO|Back. Any Ideas? DR ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope-dev] Product creation question
I've created a product called BasicDocument. I've installed it and it works great. I've also created a folderish product. Installed. When a user selects that product from the available objects list, thus creating an instance of that product, they have an option to create sub folders which contain objects like dtml documents, dtml methods, and my BasicDocument product (very similar to what happens when you instantiate a folder object, you can have a dtml method created in the new folder). I am able to have the manage_addSimpleSite function to create DTMLDocument, DTMLMethod and Folder objects but I am unable to have the function create BasicDocuments (which live in the Products directory) additionally, I am unbale to it create any Products from the Products directory, such as Local File System? The code below works great, I get a dtml document, two folders each with a dtml method in them HOW CAN I CREATE A LOCAL FILE SYSTEM OR ANY OTHER OBJECT FROM THE PRODUCTS DIRECTORY IN THIS MANAGE_ADD FUNCTION??? ob.manage_addBasicDocument(id='index_html', title='') -- THISLINESGENERATESANERROR: AttributeError: manage_addBasicDocument ref the code below. Please reply all if you are responding from the dev list as I usually don't monitor the dev list. Thanks, Dan def manage_addSimpleSite(self, id, title='', createNewFolder=0, createEditFolder=0, REQUEST=None): """Add a new SimpleSite object with id *id*. If the 'createNewFolder' and 'createEditFolder' parameters are set to any true value, an 'New sub Folder' and an 'edit sub Folder' objects are created respectively in the new SimpleSite. """ ob=SimpleSite() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None ob.manage_addBasicDocument(id='index_html', title='') -- THISLINESGENERATESANERROR: AttributeError: manage_addBasicDocument ob.manage_addDTMLDocument(id='index_html', title='') if createNewFolder: if (user is not None) and not ( user.has_permission('Add User SimpleSites', self)): raise 'Unauthorized', ( 'You are not authorized to add User SimpleSites.' ) ob.manage_addFolder(id='New'+id, title='', createPublic=1) if createEditFolder: if (user is not None) and not ( user.has_permission('Add Documents, Images, and Files', self)): raise 'Unauthorized', ( 'You are not authorized to add DTML Documents.' ) ob.manage_addFolder(id='Edit'+id, title='', createPublic=1) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1