[Zope-dev] Python products

2001-02-07 Thread Tom Deprez

Hi,

I'm wondering, is there somewhere a simple example on how to create a python
product which behaves like the following ZClasses :

A simple zclass which contains some data (this is easy with the existing
examples)
A folder-like zclass which only allows to contain the simple zclass. (easy?)

A folder-like zclass which allows to contain the 2 above classes (probably
easy if I've an example of the 2de class)

Thanks in advance,

Tom.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python products

2001-02-07 Thread Jens Quade

Chris Withers [EMAIL PROTECTED] writes:

 You may have to do somethign funky if you want to limit the types of object that

subclasses of ZClass: ObjectManager
have a "Subobjects" tab to limit the allowed meta types of the subobjects. 
Not all Folder features, but often less is more :)

jens



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python products

2001-02-07 Thread Andy McKay

Take a look at FSPoll which has sort of structure...

 You may have to do somethign funky if you want to limit the types of
object that
 appear in the 'Add' list of your new classes. I have no idea how to do
that :-S

I did that in FSPoll just last night. Basically overrode
filtered_meta_types, and iterated through the tuple of objects, discarding
ones I dont want, keeping the ones I do. I was hoping to do a how to in the
next day or so.

--
  Andy McKay.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python products

2001-02-07 Thread Andy McKay

Yep that too, this is the more secure since this limiting at the ZClass
source as opposed to my method of limiting in the mgmt interface. Ok so next
question, how do I limit what appears in the root, for example FSPoll has
three classes FSPoll, question and answer, but the latter cannot be added
anywhere except in an FSPoll Folder. So how do I limit that?
--
  Andy McKay.


- Original Message -
From: "Jens Quade" [EMAIL PROTECTED]
To: "Tom Deprez" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, February 07, 2001 7:08 AM
Subject: Re: [Zope-dev] Python products


 Chris Withers [EMAIL PROTECTED] writes:

  You may have to do somethign funky if you want to limit the types of
object that

 subclasses of ZClass: ObjectManager
 have a "Subobjects" tab to limit the allowed meta types of the subobjects.
 Not all Folder features, but often less is more :)

 jens



 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python products

2001-02-07 Thread richard

Andy McKay wrote:
 Take a look at FSPoll which has sort of structure...
 
  You may have to do somethign funky if you want to limit the types of
 object that
  appear in the 'Add' list of your new classes. I have no idea how to do
 that :-S
 
 I did that in FSPoll just last night. Basically overrode
 filtered_meta_types, and iterated through the tuple of objects, discarding
 ones I dont want, keeping the ones I do. I was hoping to do a how to in the
 next day or so.

If you have a specific set of meta types that are allowed, then set the
all_meta_types attribute on the class.


   Richard

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Python products

2001-02-07 Thread richard

Chris Withers wrote:
 Tom Deprez wrote:
  A folder-like zclass which only allows to contain the simple zclass. (easy?)
 
 Subclass OFS.Folder

or OFS.ObjectManager if you don't want properties and the other extras that
Folder has.


  A folder-like zclass which allows to contain the 2 above classes (probably
  easy if I've an example of the 2de class)

and set all_meta_types = ['My ZClass', 'My Folder'] on My Folder


 Richard

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )