Re: [Zope] Instance within Instance
Tim Cook wrote: > The folder doesn't exist until after the first response. So you > can't GET it's context in the same call you create it in. > > Make more sense? It makes perfect sense, but still doesn't work. I returned it to the two file call setup as you gave it to me and I get the same Authorization Failed error. From the folder (as it originally worked) it DOES work from a single method. It's probably not neccessary for us to continue this. If I need to do this, I can set up a clone operation much like "Stan's ZAcme Website" from the ZCMG. I'm not sure there is any effective difference - it's just not as neat... Thanks again for all your help... ___ 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] Instance within Instance
Tim Cook wrote: Well, Tim, I'm sorry to say I am back where I started :-( I took your (working) example and modified it. I want to be able to add the MyClass1/MyClass2 combo from the management interface (the add product thing). I combined all the code into MyClass1_add. If I use this: > > > I get a permission denied error. If I remove the with wrapper, I get the MyClass2 instance, but ALONGSIDE rather than within the MyClass1 instance. This is pretty much the same thing I got before you sent me the product so I guess I wasn't that far off :-) I fooled around with permissions as much as I could and couldn't make it work. Any ideas there? Thanks again. -- "Where is the fancy bread, in the heart or in the head?" Daryl Stultz - python, zope, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ 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] Instance within Instance
Tim Cook wrote: > > Daryl, > > Import the DarylProduct.zexp into your Products folder. > The DarylExample.zexp can go anywhere in you Zope tree. As luck would have it, the file did not import into Products (File /usr/local/Zope/lib/python/OFS/CopySupport.py, line 406, in _verifyObjectPaste) It DID import into the root folder (I did this purely by accident!) I was then able to recreate the called-for classes and IT WORKED!! I haven't figured out HOW yet but I will. Thanks a lot for the help, and let me know if you need any fancy Python methods... Cheers. -- "Where is the fancy bread, in the heart or in the head?" Daryl Stultz - python, zope, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ 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] Rookie Question - Syntax
Walter Pleyer wrote: > I must check if some must-fields from a form were filled out by a user. > Checking data from a single field is no problem, but what's the correct > syntax for checking more than one field (e.g. "name", "address", "email") ? I probably could answer your question as stated, but I'm too lazy. Instead, I will say that you should do such a thing from JavaScript instead. This is a discussion for elsewhere, and I'd be happy to take the discussion off-line... -- "Where is the fancy bread, in the heart or in the head?" Daryl Stultz - python, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ 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] Instance within Instance
Tim Cook wrote: > I guarantee that you will end up with a folder MyClass1ID that > contains MyClass2ID. You've been very helpful, here, Tim, but I simply can't get this to work. I'm wondering if you might be able to create such a product for me and send it to me: One product with two classes, creating one class from the manager creates the first class with the second inside it. Maybe I can write some Python for you or something in exchange :-) Thanks. -- "Where is the fancy bread, in the heart or in the head?" Daryl Stultz - python, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ 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] Instance within Instance
Tim Cook wrote: > The problem here is that even though you set REQUEST, it is a > string. You need to be in the context of the parent _object_. You > should try . Sorry, I thought of more... It's my understanding that dtml-with simply pushes a namespace onto the stack. What relationship does this have with the context that a new ZClass instance is created in? -Daryl ___ 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] Instance within Instance
Tim Cook wrote: > The problem here is that even though you set REQUEST, it is a > string. You need to be in the context of the parent _object_. You > should try . What's happening now is that my class2 is getting created at the same level as class1. What I want is class2 to be INSIDE class1. So I don't want the parent context, I want the class1 context. gets me the class2 instance at the same level... How can I get a new context of the newly created class1 instance? Thanks. Daryl Stultz - python, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ 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] Instance within Instance
> You should look at the source of your "class2_add", > especially the constructor that creates the object. > > I expect, that you use "class2.createInObjectManager" > to create your "class2" instance. > "C.createInObjectManager" usually uses "C.aq_parent" to > determine the object manager where the new C instance > should be created (unless it has a "Destination" attribute). > This should be your "class1" instance "instance1", more > precisely, an acquisition wrapper for it. Wowsers! This is all a little over my head... I've scoured the docs and I can't find anything on aq_parent. (And createInObjectManager is weak...) Wouldn't the object manager (to add object to) be determined by the URL? I've done REQUEST.set('URL','...myClass1/') but that doesn't help. Isn't there SOMETHING in the REQUEST object that tells it where things should get created? Anymore info (or pointers to better docs) would be great. Thanks. Daryl Stultz - python, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ 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] Instance within Instance
Tim Cook wrote: > NOT TESTED, but simialr to something I do: > > > > > > Hmmm, doesn't seem to be working (also results in class1 and class2 being at same level). I'll take a look at some other examples. Thanks for the help (and quick replies). ___ 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] Instance within Instance
Hi Folks, I have a product folder called "TestClass" with 2 ZClasses: class1 and class2. The following is an exerpt from the class1 constructor: I want class2 to be created INSIDE of the class 1 instance. Instead, class2 (always with an id of "myClass2") is created at the same level as the class1 instance. How do I change the namespace to get the class2 instance inside class1? Thanks. -- "I ain't no stewin' rabbit, I'm a fricassein' rabbit. Have you got a fricassein' rabbit license?" Daryl Stultz - python, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ 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] ZClass within ZClass
Tim Cook wrote: > But, If you subclass OFS:Folder when building CDLibrary and > CDManager then they can 'contain' other objects. > A HOWTO that really helped me was the one on building a Job > Board. Yes, that's precisely where I started, however, the actual product is a job_board_entry. What I want is a product that IS the entire job board, contains an object that is a job_board_entry manager (holds the entries) and then, the user creates job_board_entries. In the example, the job board itself, and the "manager" are done with folders. Following the ZCMG example (Stan's InstantSite), I can clone such a setup - but I don't get full class modification cascading, i.e., once it's duplicated, only changes to the job_board_entry class will carry through existing job boards. I'll keep at it, though. I hope this is all clear. Thanks. -- "I ain't no stewin' rabbit, I'm a fricassein' rabbit. Have you got a fricassein' rabbit license?" Daryl Stultz - python, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ 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] ZClass within ZClass
Hi folks, I am yet another Zope newbie. I am trying to create a ZClass hierarchy. Let's say I have a CDLibrary. Every CDLibrary has a CDManager (just one) and the CDManger holds all the CDEntry items. (The CDLibrary may have parts other than the CDManager, like a label maker or something- but that's not important now...) My question is this: How do I set up such a product with ZClasses within ZClasses. I have the HOW-TO collection, the ZBook, the Zope Book and the Guides. I've tried the HOW-TO on ZClasses and ObjectManagers, and Adding ZClass Instances Programmatically with no success. I am an experienced Python programmer with strong object-oriented knowledge and good HTML. Any help will be greatly appreciated. Thanks. -- "I ain't no stewin' rabbit, I'm a fricassein' rabbit. Have you got a fricassein' rabbit license?" Daryl Stultz - python, blender, robots, really bad harmonica playing... [EMAIL PROTECTED] RedHat Linux 6.1 - Dual Pentium Pro ___ 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 )