Switching maling list here.
On 10/3/05, Johan Carlsson <[EMAIL PROTECTED]> wrote:
> Hi all,
> I want to replace the pasteable in
> for all content types.
> I've created a sub class to Contents which override
> the pasteable but I'm not sure how to configure it
> to override the default class (if possible)?
> Best Regards,
> PS. The reason I want to change pasteable is that it
> raises an exception if the paste action is unknown.
> I'm implementing a clone action as an extra variation
> of copy and it works in my classes but if I point
> to a stock object (with anything I want to clone in
> the clipbook) I get an error due to the raise.
> My override returns False if the paste action is unknown.
> Any core developer that has any opinion on this?
> Can it be changed in the core or is there a specific
> reason for the raise?
The standard Contents.pasteable and pasteObjects is hardcoded for two
actions, 'copy' and 'cut'. I have the feeling here that it could be
cool to actually use adapters instead, so that you adapt yourself to
the paste action you want? Or is that overkill.
Seondly, Johan has discovered a bug. pasteable raises an error when
you try a pste action that is not supported (ie anything else that
'cut' and 'copy'). Ut should return False. It's a copy/paste error
from pasteObjects, ironically enough. ;)
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
Zope3-dev mailing list