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

Mailing List Archive: Zope: CMF
Customising types with add views
 

Index | Next | Previous | View Flat


optilude at gmx

Dec 8, 2008, 7:20 AM


Views: 611
Permalink
Customising types with add views

Hi,

Currently, we have this situation (on trunk):

- Add views are looked up by evaluating the FTI add_view_expr

- The default/conventional add_view_expr is

string:${folder_url}/++add++<typename>

- This will look for an adapter (context, request, fti) with name =
fti.factory and return that as the add view

Let's consider a type Alpha that has a custom add form registered as
such a (context, request, fti) adapter with name "Alpha". fti.factory is
"Alpha", and there's a corresponding IFactory utility (with name "Alpha").

Now, let's say I want to create a new type Beta (e.g. by copying the FTI
object TTW), based on Alpha. I want this to use Alpha's add form, but
construct objects with portal_type Beta.

Is this possible? If I set Beta's fti.factory to be something other than
"Alpha", then it won't find the add view, but if fti.factory is "Alpha"
then the objects constructed will use Alpha's factory.

I can't quite decide whether this is a problem in real life or not,
although it does seem a bit strange that the add view adapter name and
the factory utility name have to be the same.

Would it make sense to decouple these, e.g. with a new "add_view_name"
property?

Martin

--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

_______________________________________________
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
Customising types with add views optilude at gmx Dec 8, 2008, 7:20 AM
    Re: Customising types with add views y.2008 at wcm-solutions Dec 8, 2008, 10:08 AM
        Re: Customising types with add views optilude at gmx Dec 8, 2008, 4:22 PM
            Re: Customising types with add views y.2008 at wcm-solutions Dec 9, 2008, 4:49 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.