Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF
Extending FTI.isConstructionAllowed
 

Index | Next | Previous | View Flat


wichert at wiggy

May 29, 2009, 4:41 AM


Views: 1041
Permalink
Extending FTI.isConstructionAllowed

I have a use case where I need to put additional restrictions on object
creation, in particular I need to restrict the maximum depth of items
inside of a container of a specific type. The ideal place to put such a
restriction seems to be the isConstructionAllowed method on the FTI.
Currently this method is not very extensible, which leads to complicated
code in various FTI types.

I am considering to add an extension point here, something like this:

class ITypeConstructionFilter(Interface):
def __init__(fti, container):
"""Adapt on the FTI of the object being created and the target
container"""

def allowed():
"""Check if construction is allowed."""


current checks such as the workflow check that was added in CMF 2.2, or
the type constraint logic Plone has in ATContentTypes could be moved to
such an adapter. The standard isConstructionAllowed method could then
query all registered adapters to check if construction should be possible.

Does this sound sensible?

Wichert.

_______________________________________________
Zope-CMF maillist - Zope-CMF[at]lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

Subject User Time
Extending FTI.isConstructionAllowed wichert at wiggy May 29, 2009, 4:41 AM
    Re: Extending FTI.isConstructionAllowed y.2009 at wcm-solutions May 29, 2009, 6:21 AM
        Re: Extending FTI.isConstructionAllowed wichert at wiggy May 29, 2009, 6:50 AM
            Re: Extending FTI.isConstructionAllowed y.2009 at wcm-solutions May 29, 2009, 8:04 AM
                Re: Extending FTI.isConstructionAllowed wichert at wiggy Jun 2, 2009, 4:57 AM
                    Re: Extending FTI.isConstructionAllowed y.2009 at wcm-solutions Jun 2, 2009, 5:23 AM
                        Re: Extending FTI.isConstructionAllowed wichert at wiggy Jun 2, 2009, 5:47 AM
                            Re: Extending FTI.isConstructionAllowed charlie at begeistert Jun 3, 2009, 1:08 AM
    Re: Extending FTI.isConstructionAllowed tseaver at palladion May 29, 2009, 6:56 AM
        Re: Extending FTI.isConstructionAllowed wichert at wiggy Jun 2, 2009, 4:21 AM
            Re: Extending FTI.isConstructionAllowed tseaver at palladion Jun 2, 2009, 9:35 AM
                Re: Extending FTI.isConstructionAllowed tseaver at palladion Jun 2, 2009, 9:51 AM
    Re: Extending FTI.isConstructionAllowed wichert at wiggy Jun 2, 2009, 4:59 AM
    Re: Extending FTI.isConstructionAllowed wichert at wiggy Jun 3, 2009, 1:12 AM
        Re: Extending FTI.isConstructionAllowed charlie at begeistert Jun 3, 2009, 1:29 AM
    Re: Extending FTI.isConstructionAllowed y.2009 at wcm-solutions Jun 3, 2009, 6:35 AM
        Re: Extending FTI.isConstructionAllowed wichert at wiggy Jun 4, 2009, 12:34 AM
            Re: Extending FTI.isConstructionAllowed y.2009 at wcm-solutions Jun 4, 2009, 5:58 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.