[Zope3-Users] Re: Registering adapter for ListSequence widget in tests

2006-09-06 Thread Philipp von Weitershausen

TAHARA Yusei wrote:

I think you should use zope.app.testing.ztapi.provideAdapter instead.


No! ztapi.provideAdapter is discouraged. zope.component.provideAdapter 
is the recommended spelling.


Philipp

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


Re: [Zope3-Users] Re: Registering adapter for ListSequence widget in tests

2006-09-06 Thread TAHARA Yusei
At Wed, 06 Sep 2006 09:29:15 +0200,
Philipp von Weitershausen wrote:
 
 TAHARA Yusei wrote:
  I think you should use zope.app.testing.ztapi.provideAdapter instead.
 
 No! ztapi.provideAdapter is discouraged. zope.component.provideAdapter 
 is the recommended spelling.

Oh, sorry. I did not know that...

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


Re: [Zope3-Users] Re: Registering adapter for ListSequence widget in tests

2006-09-06 Thread Philipp von Weitershausen

TAHARA Yusei wrote:

At Wed, 06 Sep 2006 09:29:15 +0200,
Philipp von Weitershausen wrote:

TAHARA Yusei wrote:

I think you should use zope.app.testing.ztapi.provideAdapter instead.
No! ztapi.provideAdapter is discouraged. zope.component.provideAdapter 
is the recommended spelling.


Oh, sorry. I did not know that...


You couldn't have. It's not officially deprecated. It's just discouraged.
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Registering adapter for ListSequence widget in tests

2006-09-06 Thread Darryl Cousins
Ok. Thanks Tahara and Philipp. I am using component.provideAdapter.

What I am having trouble with is registering ListSequenceWidget for use
in a doctest.

I believe the matching zcml from zope.form.browser configure is:

view
type=zope.publisher.interfaces.browser.IBrowserRequest
for=zope.schema.interfaces.IList
 zope.schema.interfaces.IField
provides=zope.app.form.interfaces.IInputWidget
factory=.ListSequenceWidget
permission=zope.Public
/

My own attempt to register the widget for a doctest is:


 zope.component.provideAdapter(ListSequenceWidget, \
...   [IList, IField, IBrowserRequest], \
...IInputWidget)

The error on running doctest is:

ComponentLookupError: ((zope.schema._field.List object at
0xb704532c,
zope.publisher.browser.TestRequest instance URL=http://127.0.0.1),
InterfaceClass zope.app.form.interfaces.IInputWidget, u'')

The relavant part of the schema to be rendered is:

addlanguage = List(
title = _(Language),
description = _(Add language to content),
required = False,
default = [],
value_type = TextLine(
title = _(Langauge)))

Thanks,
Darryl


On Wed, 2006-09-06 at 09:41 +0200, Philipp von Weitershausen wrote:
 TAHARA Yusei wrote:
  At Wed, 06 Sep 2006 09:29:15 +0200,
  Philipp von Weitershausen wrote:
  TAHARA Yusei wrote:
  I think you should use zope.app.testing.ztapi.provideAdapter instead.
  No! ztapi.provideAdapter is discouraged. zope.component.provideAdapter 
  is the recommended spelling.
  
  Oh, sorry. I did not know that...
 
 You couldn't have. It's not officially deprecated. It's just discouraged.
 ___
 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