Re: [Zope3-Users] still filter in addmenuitem

2007-04-07 Thread Ivan Horvath

sorry for attaching files, but in this way may be it will be more clear.
on the Type object.gif you can see that Article can be added to Type objects.
on the Article object.gif you can see that nothing can be added to an
Article object (manually). that's why i use the filter, but the Add
menu point is still visible (rounded with read drawing). and if you
click on it you can see on the article add.gif the screen.
to complete the whole story Article can contain other Article objects,
only the manual adding needs to be disabled.


On 4/4/07, Christophe Combelles [EMAIL PROTECTED] wrote:

I don't really understand, do you want to hide the full Add menu, or just the
menu entry for your content object?

Remember you can also filter the menu entry by interface and not only with the
filter. (btw I've never used this filter yet)

Christophe

Ivan Horvath a écrit :
 Dear All,

 as i wrote in one of my previous e-mail i use filter property in
 addMenuItem directive.
 filter = context/context/isNeedtoDisplay | nothing

 the add menu (below the navigation tree) is not displaying for the
 certain object, but there is an  Add menu in zmi_actions menu bar.
 when i click on it it displays an empty textbox to create an object.
 how can i disappear it? or is it a bug?

 Ivan
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users



___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users



Type object.gif
Description: GIF image


Article object.gif
Description: GIF image


article add.gif
Description: GIF image
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: execution time of a request?

2007-04-07 Thread David Pratt
Hi Jurgen and Marius. Can you advise whether the profiling library is 
generally available and if so where to find it. Many thanks.


Regards,
David


Jürgen Kartnaller wrote:

By the way, marius, thanks for your great profiling library.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: execution time of a request?

2007-04-07 Thread Christophe Combelles

You can find interesting things on his blog:
http://mg.pov.lt/blog/benchmarking-zope3-apps.html

Christophe

David Pratt a écrit :
Hi Jurgen and Marius. Can you advise whether the profiling library is 
generally available and if so where to find it. Many thanks.


Regards,
David


Jürgen Kartnaller wrote:

By the way, marius, thanks for your great profiling library.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users




___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: execution time of a request?

2007-04-07 Thread David Pratt

Hi Cristophe. Found it and it looks helpful for sure. Many thanks.

Regards,
David

Christophe Combelles wrote:

You can find interesting things on his blog:
http://mg.pov.lt/blog/benchmarking-zope3-apps.html

Christophe

David Pratt a écrit :
Hi Jurgen and Marius. Can you advise whether the profiling library is 
generally available and if so where to find it. Many thanks.


Regards,
David


Jürgen Kartnaller wrote:

By the way, marius, thanks for your great profiling library.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users




___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] EditForm fails in SiteManager because of containment constraint

2007-04-07 Thread Christophe Combelles

Hello,

I have a regular content object which uses the formlib for its edit view.
Nothing special, just like a Recipe.
But I want this object to only reside in the Site Manager, because it will be 
used as a configurable local utility (some kind of LocalKitchenTools utility)


Everything is perfect, and the EditForm works well until I want to tell this 
object to be only contained in the SiteManager. So I just add this statement in 
the interface:


containers(ILocalSiteManager)
or
containers(ISiteManagementFolder)

When I do any of these, the EditForm fails with a ComponentLookupError
What Am I missing? Why does a simple constraint create an error on this?

Christophe



 Error object: ((zope.schema._bootstrapfields.Field object at 0xb58a9bec, 
zope.publisher.browser.BrowserRequest instance 
URL=http://localhost:9673/++lang++en/++skin++Debug/testsite/++etc++site/default/ppp/@@edit.html), 
InterfaceClass zope.app.form.interfaces.IInputWidget, u'')


  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, line 
133, in publish

result = publication.callObject(request, obj)

  File 
/usr/lib/python2.4/site-packages/zope/app/publication/zopepublication.py, line 
161, in callObject

return mapply(ob, request.getPositionalArguments(), request)

  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, line 
108, in mapply

return debug_call(obj, args)

  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, line 
114, in debug_call

return obj(*args)

  File /usr/lib/python2.4/site-packages/zope/formlib/form.py, line 769, 
in __call__

self.update()

  File /usr/lib/python2.4/site-packages/zope/formlib/form.py, line 732, 
in update

self.setUpWidgets()

  File /usr/lib/python2.4/site-packages/zope/formlib/form.py, line 802, 
in setUpWidgets

adapters=self.adapters, ignore_request=ignore_request

  File /usr/lib/python2.4/site-packages/zope/formlib/form.py, line 393, 
in setUpEditWidgets

widget = _createWidget(form_field, field, request, iface)

  File /usr/lib/python2.4/site-packages/zope/formlib/form.py, line 323, 
in _createWidget

return component.getMultiAdapter((field, request), iface)

  File /usr/lib/python2.4/site-packages/zope/component/_api.py, line 103, 
in getMultiAdapter

raise ComponentLookupError(objects, interface, name)


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: EditForm fails in SiteManager because of containment constraint

2007-04-07 Thread Jürgen Kartnaller

Christophe Combelles wrote:

Hello,

I have a regular content object which uses the formlib for its edit view.
Nothing special, just like a Recipe.
But I want this object to only reside in the Site Manager, because it 
will be used as a configurable local utility (some kind of 
LocalKitchenTools utility)


Everything is perfect, and the EditForm works well until I want to tell 
this object to be only contained in the SiteManager. So I just add this 
statement in the interface:


containers(ILocalSiteManager)
or
containers(ISiteManagementFolder)


'container' adds __parent__ as schema.Field attribute to your interface.
You need to omit __parent__ in your formlib form_fields definition.

Jürgen

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] EditForm fails in SiteManager because of containment constraint

2007-04-07 Thread Christophe Combelles

OK, I've finally found,
Actually, it was failing also in the content side

My object is not IContained.
And since I'm adding containment constraints, I guess my object was considered 
Contained (containment proxy?). So the EditForm was expecting __name__ and 
__parent__ and was failing somewhere.


I've just added omit('__name__', '__parent__') in the form and it works.

But I can't explain why I have to add this omit() when my object is not 
contained. Is it silly to add a containment constraint on a not Contained 
object?  Shouldn't the containment proxy manage this by itself?


Christophe


Christophe Combelles a écrit :

Hello,

I have a regular content object which uses the formlib for its edit view.
Nothing special, just like a Recipe.
But I want this object to only reside in the Site Manager, because it 
will be used as a configurable local utility (some kind of 
LocalKitchenTools utility)


Everything is perfect, and the EditForm works well until I want to tell 
this object to be only contained in the SiteManager. So I just add this 
statement in the interface:


containers(ILocalSiteManager)
or
containers(ISiteManagementFolder)

When I do any of these, the EditForm fails with a ComponentLookupError
What Am I missing? Why does a simple constraint create an error on this?

Christophe



 Error object: ((zope.schema._bootstrapfields.Field object at 
0xb58a9bec, zope.publisher.browser.BrowserRequest instance 
URL=http://localhost:9673/++lang++en/++skin++Debug/testsite/++etc++site/default/ppp/@@edit.html), 
InterfaceClass zope.app.form.interfaces.IInputWidget, u'')


  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, 
line 133, in publish

result = publication.callObject(request, obj)

  File 
/usr/lib/python2.4/site-packages/zope/app/publication/zopepublication.py, 
line 161, in callObject

return mapply(ob, request.getPositionalArguments(), request)

  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, 
line 108, in mapply

return debug_call(obj, args)

  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, 
line 114, in debug_call

return obj(*args)

  File /usr/lib/python2.4/site-packages/zope/formlib/form.py, line 
769, in __call__

self.update()

  File /usr/lib/python2.4/site-packages/zope/formlib/form.py, line 
732, in update

self.setUpWidgets()

  File /usr/lib/python2.4/site-packages/zope/formlib/form.py, line 
802, in setUpWidgets

adapters=self.adapters, ignore_request=ignore_request

  File /usr/lib/python2.4/site-packages/zope/formlib/form.py, line 
393, in setUpEditWidgets

widget = _createWidget(form_field, field, request, iface)

  File /usr/lib/python2.4/site-packages/zope/formlib/form.py, line 
323, in _createWidget

return component.getMultiAdapter((field, request), iface)

  File /usr/lib/python2.4/site-packages/zope/component/_api.py, 
line 103, in getMultiAdapter

raise ComponentLookupError(objects, interface, name)


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users




___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: EditForm fails in SiteManager because of containment constraint

2007-04-07 Thread Christophe Combelles

Jürgen Kartnaller a écrit :

Christophe Combelles wrote:

Hello,

I have a regular content object which uses the formlib for its edit view.
Nothing special, just like a Recipe.
But I want this object to only reside in the Site Manager, because it 
will be used as a configurable local utility (some kind of 
LocalKitchenTools utility)


Everything is perfect, and the EditForm works well until I want to 
tell this object to be only contained in the SiteManager. So I just 
add this statement in the interface:


containers(ILocalSiteManager)
or
containers(ISiteManagementFolder)


'container' adds __parent__ as schema.Field attribute to your interface.
You need to omit __parent__ in your formlib form_fields definition.



thanks, that's it, so I will omit only __parent__
You had already answered while I was still writing my previous post :)

Couldn't this thing be managed by the formlib itself?
The error is not explicit and does not mention __parent__ anywhere


Christophe



Jürgen

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users




___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users