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.
Tom Deprez wrote:
A simple zclass which contains some data (this is easy with the existing examples)
Yup
A folder-like zclass which only allows to contain the simple zclass. (easy?)
Subclass OFS.Folder
A folder-like zclass which allows to contain the 2 above classes (probably easy if I've an example of the 2de class)
Ditto 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 cheers, Chris
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.
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 richard@bizarsoftware.com.au Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)
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 richard@bizarsoftware.com.au Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)
participants (4)
-
Andy McKay -
Chris Withers -
richard@bizarsoftware.com.au -
Tom Deprez