<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Florian Lindner napisał(a):
<blockquote cite="mid200604011743.06183.mailinglists@xgm.de" type="cite">
  <pre wrap="">Am Samstag, 1. April 2006 15:15 schrieb Alek Kowalczyk:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hello,

I have a simple (on the first sight) problem, which I don't know how to
resolve in zope3'ish way.

I have a single object, which can contain many objects of 2 another
types (IType1, IType2). My intention is to have those objects contained
in separate collections (because they are very different 2 types of
objects and should not be mixed in one collection)
I'd like to have each collection editable like Zope folder, i.e each
collection to be IContainer/BTreeContainer.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
[...]

Hi,
why don't just create two subfolders (of type zope.folder) in you Container 
object, one for IType1, one for IType2?

Regards,

Florian

  </pre>
</blockquote>
Good idea, thanks! In the meantime I have made something similar, i.e
defined two more container types (IObjects1, IObjects2) and created one
IObjects1 and one IObjects2 in the IMasterObject's (which now is also a
IContainer) constructor .<br>
<br>
But now the new question follows:  how to limit cardinality of items? I
want now to have one and exactly one IObjects1 and IObjects2 instance
in IMasterObject. Is there some type of constraint defined, similar to
ItemTypeConstraint, for limiting number of elements of specific type,
or I should do it on my own by overriding __setitem__ and other
methods? <br>
<br>
<br>
<br>
</body>
</html>