Re: [Zope] Rookie Question - Syntax

2000-11-29 Thread Daryl Stultz

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

2000-11-29 Thread Daryl Stultz

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] Instance within Instance

2000-11-29 Thread Daryl Stultz

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:

   dtml-with "manage_addProduct['DarylExample']"
 dtml-call expr="MyClass2_add(_.None, _, NoRedir=1)"
   /dtml-with

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

2000-11-28 Thread Daryl Stultz

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

2000-11-27 Thread Daryl Stultz

 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 )




[Zope] ZClass within ZClass

2000-11-26 Thread Daryl Stultz

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 )




Re: [Zope] ZClass within ZClass

2000-11-26 Thread Daryl Stultz

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] Instance within Instance

2000-11-26 Thread Daryl Stultz

Hi Folks,
I have a product folder called "TestClass" with 2 ZClasses: class1 and
class2.
The following is an exerpt from the class1 constructor:

dtml-with "class1.createInObjectManager(REQUEST['id'], REQUEST)"
  dtml-call "REQUEST.set('id', 'myClass2')"
  dtml-call "class2_add(_.None, _, NoRedir=1)"
/dtml-with

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] Instance within Instance

2000-11-26 Thread Daryl Stultz

Tim Cook wrote:

 NOT TESTED, but simialr to something I do:
 
 dtml-call expr="class1.createInObjectManager(REQUEST['id'],
 REQUEST)"
 dtml-with "_.getitem(id)"
   dtml-call "REQUEST.set('id', 'myClass2')"
   dtml-call "class2_add(_.None, _, NoRedir=1)"
 /dtml-with

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 )