#55 — AttributeError: NamedVocabulary instance has no attribute '__getitem__'
by
Franklin Kingma
—
last modified
Apr 25, 2009 05:06 AM
| State | Confirmed |
|---|---|
| Version: | 1.4 |
| Area | Functionality |
| Issue type | Bug |
| Severity | Medium |
| Submitted by | Franklin Kingma |
| Submitted on | Jan 11, 2009 |
| Responsible |
—
|
| Target release: |
—
|
I have ATVocabularyManager installed in a plone 3.2 site, a custom content-type with a multipleselectwidget which uses a NamedVocabulary
vocabulary=NamedVocabulary("""branche"""),
'branche' is there is the vocabulary manager and the same setup works in 3.1.x
But in 3.2 i get this attribute error
Module zope.tales.tales, line 696, in evaluate
URL: file:/opt/cka-nieuw/eggs/Products.Archetypes-1.5.10-py2.4.egg/Products/Archetypes/skins/archetypes/widgets/multiselection.pt
Line 11, Column 4
Expression: <PythonExpr field.Vocabulary(here)>
Names:
{'container': <PloneSite at /site>,
'context': <Lid at /site/de-leden/marieke-karssen>,
'default': <object object at 0x2b1c89217210>,
'here': <Lid at /site/de-leden/marieke-karssen>,
'loop': {u'field': <Products.PageTemplates.Expressions.PathIterator object at 0x2aaaadb0bad0>},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x6aade60>,
'request': <HTTPRequest, URL=http://cka.fourdigits.nl/[…]/base_view>,
'root': <Application at >,
'template': <FSPageTemplate at /site/base_view used for /site/de-leden/marieke-karssen>,
'traverse_subpath': [],
'user': <PropertiedUser 'theone'>}
Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
__traceback_info__: field.Vocabulary(here)
Module PythonExpr, line 1, in <expression>
Module Products.Archetypes.Field, line 480, in Vocabulary
AttributeError: NamedVocabulary instance has no attribute '__getitem__'
vocabulary=NamedVocabulary("""branche"""),
'branche' is there is the vocabulary manager and the same setup works in 3.1.x
But in 3.2 i get this attribute error
Module zope.tales.tales, line 696, in evaluate
URL: file:/opt/cka-nieuw/eggs/Products.Archetypes-1.5.10-py2.4.egg/Products/Archetypes/skins/archetypes/widgets/multiselection.pt
Line 11, Column 4
Expression: <PythonExpr field.Vocabulary(here)>
Names:
{'container': <PloneSite at /site>,
'context': <Lid at /site/de-leden/marieke-karssen>,
'default': <object object at 0x2b1c89217210>,
'here': <Lid at /site/de-leden/marieke-karssen>,
'loop': {u'field': <Products.PageTemplates.Expressions.PathIterator object at 0x2aaaadb0bad0>},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x6aade60>,
'request': <HTTPRequest, URL=http://cka.fourdigits.nl/[…]/base_view>,
'root': <Application at >,
'template': <FSPageTemplate at /site/base_view used for /site/de-leden/marieke-karssen>,
'traverse_subpath': [],
'user': <PropertiedUser 'theone'>}
Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
__traceback_info__: field.Vocabulary(here)
Module PythonExpr, line 1, in <expression>
Module Products.Archetypes.Field, line 480, in Vocabulary
AttributeError: NamedVocabulary instance has no attribute '__getitem__'
Added by
Harald Friessnegger
on
Jan 12, 2009 10:54 AM
Issue state:
Unconfirmed
→
Confirmed
Can confirm this bug on 1.4.2. It's fixed on trunk, however.
Until the next release comes up you can use the following part in your buildout to use the current trunk instead of the released 1.4.2 egg (you can use a fixed revision too with this recipe)::
[eggcheckouts]
recipe = infrae.subversion
as_eggs = true
urls =
http://svn.plone.org/[…]/trunk Products.ATVocabularyManager
and include it before zope2::
parts =
eggcheckouts
zope2
@jensens: shall we release a 1.4.3 with this single fix or will you release 1.5 soon anyway?
Background
----------
Products/Archetypes/Field.py(474) is checking for IVocabulary the z3 way::
IVocabulary.providedBy(value)
ATVM 1.4.2 relies on an old style interface for IVocabulary::
__implements__ = (IVocabulary,)
Archetypes must have changed the vocabulary to be a z3 style one one of the last releases.
The trunk version of ATVM already makes NamedVocabulary implement IVocabulary.
(see http://dev.plone.org/[…]/namedvocabulary.py)
Added by
Harald Friessnegger
on
Jan 12, 2009 11:23 AM
added a buildout to ATVocabularyManager repos so developers can easily set up a sandbox.
it contains an example of how to use ATVM trunk in a plone3.2 buildout:
http://dev.plone.org/[…]/buildout.cfg
Added by
(anonymous)
on
Apr 20, 2009 04:28 PM
hi, i stubled upon the same bug right now.i really would appreciate a release to fix that bug. (copied from old.plone.org ... sorry)
Added by
T. Kim Nguyen
on
Apr 25, 2009 05:06 AM
How would one get the trunk version installed via easy_install? (if given the above URL to the trunk version, it fails with error 403 forbidden). Thanks...
No responses can be added.
If you can, please log in before submitting a reaction.
