troubles with Backreferences ('RelationPropertyIn')

Bug #180597 reported by Jodok Batlogg
4
Affects Status Importance Assigned to Milestone
lovely.relation
New
Undecided
Unassigned

Bug Description

katja süss <email address hidden> reports:

Hallo

Habe mir für einen Prototyp das Zope3 package lovely.relations angeschaut. Dabei bin ich auf ein Problem bei Backreferences ('RelationPropertyIn') gestossen. s.u.

Konnte dies wie im Attachment zu sehen beheben.

Als Autor des Package ist jemand namens jukart angegeben. Bitte entsprechend weiterleiten, danke.

Ansonsten ist das package eine tolle Sache! Kompliment.

Gruss, Katja

--

::

CroJeWe :: Katja Süss
Information Systems :: Content Management und Media
Ausstellungsstr.36
8005 Zürich

mail: <email address hidden>
fon: +41 43 534 51 10
mobile: +41 79 209 71 13
skype: katja.suess
web: http://www.crojewe.ch

--------------------

Beim Setzen einer Backreference wurde folgender Fehler geworfen:

backrefs = RelationPropertyIn(relatedFilesManager)

Als Widget wird ein modifiziertes OrderedMultiSelectWidget verwendet.

2008-01-05T15:17:02 ERROR SiteError http://localhost:9002/datashare/p1/f1/edit
Traceback (most recent call last):
File "/Users/katjasuess/buildout-eggs/zope.publisher-3.4.1-py2.4.egg/zope/publisher/publish.py", line 133, in publish
  result = publication.callObject(request, obj)
File "/Users/katjasuess/buildout-eggs/tmpf0TeKO/grok-0.10.2-py2.4.egg/grok/publication.py", line 41, in callObject
File "/Users/katjasuess/buildout-eggs/tmp78nkUq/zope.app.publication-3.4.2-py2.4.egg/zope/app/publication/zopepublication.py", line 167, in callObject
File "/Users/katjasuess/buildout-eggs/zope.publisher-3.4.1-py2.4.egg/zope/publisher/publish.py", line 108, in mapply
  return debug_call(obj, args)
 - __traceback_info__: <datashare.filefile.Edit object at 0x6de0f90>
File "/Users/katjasuess/buildout-eggs/zope.publisher-3.4.1-py2.4.egg/zope/publisher/publish.py", line 114, in debug_call
  return obj(*args)
File "/Users/katjasuess/buildout-eggs/grok-0.10.2-py2.4.egg/grok/components.py", line 387, in __call__
  self.update_form()
File "/Users/katjasuess/buildout-eggs/grok-0.10.2-py2.4.egg/grok/components.py", line 359, in update_form
  super(GrokForm, self).update()
File "/Users/katjasuess/buildout-eggs/zope.formlib-3.4.0-py2.4.egg/zope/formlib/form.py", line 764, in update
  result = action.success(data)
File "/Users/katjasuess/buildout-eggs/grok-0.10.2-py2.4.egg/grok/formlib.py", line 18, in success
  return self.success_handler(self.form, **data)
File "/Users/katjasuess/grok/datashare/src/datashare/filefile.py", line 63, in save
  self.applyData(self.context, **data)
File "/Users/katjasuess/buildout-eggs/grok-0.10.2-py2.4.egg/grok/components.py", line 425, in applyData
  self.adapters, update=True)
File "/Users/katjasuess/buildout-eggs/grok-0.10.2-py2.4.egg/grok/formlib.py", line 139, in apply_data_event
  changes = apply_data(context, form_fields, data, adapters, update)
File "/Users/katjasuess/buildout-eggs/grok-0.10.2-py2.4.egg/grok/formlib.py", line 127, in apply_data
  field.set(adapter, newvalue)
File "/Users/katjasuess/buildout-eggs/zope.schema-3.4.0-py2.4.egg/zope/schema/_bootstrapfields.py", line 183, in set
  setattr(object, self.__name__, value)
File "/Users/katjasuess/buildout-eggs/lovely.relation-1.1.2a1-py2.4.egg/lovely/relation/property.py", line 346, in __set__
  self._manager.setSources(inst, value, self._relType)
File "/Users/katjasuess/buildout-eggs/lovely.relation-1.1.2a1-py2.4.egg/lovely/relation/property.py", line 174, in setSources
  self.util.add(rel)
File "/Users/katjasuess/buildout-eggs/tmpADttbO/lovely.relation-1.1.2a1-py2.4.egg/lovely/relation/app.py", line 327, in add
File "/Users/katjasuess/buildout-eggs/zc.relationship-1.1-py2.4.egg/zc/relationship/index.py", line 207, in index
  self.index_doc(self._relTools['dump'](rel, self, {}), rel)
File "/Users/katjasuess/buildout-eggs/zc.relationship-1.1-py2.4.egg/zc/relationship/index.py", line 256, in index_doc
  values, tokens, gen = self._getValuesAndTokens(rel, data)
File "/Users/katjasuess/buildout-eggs/zc.relationship-1.1-py2.4.egg/zc/relationship/index.py", line 169, in _getValuesAndTokens
  tokens = data['TreeSet'](
File "/Users/katjasuess/buildout-eggs/zc.relationship-1.1-py2.4.egg/zc/relationship/index.py", line 170, in <generator expression>
  data['dump'](o, self, cache) for o in values)
File "/Users/katjasuess/buildout-eggs/tmpADttbO/lovely.relation-1.1.2a1-py2.4.egg/lovely/relation/app.py", line 133, in intIdDump
File "/Users/katjasuess/buildout-eggs/zc.relationship-1.1-py2.4.egg/zc/relationship/index.py", line 71, in generateToken
  return intids.register(obj)
File "/Users/katjasuess/buildout-eggs/tmpnZtfyK/zope.app.intid-3.4.0a2-py2.4.egg/zope/app/intid/__init__.py", line 122, in register
File "/Users/katjasuess/buildout-eggs/tmpzxi5Fh/zope.app.keyreference-3.4.0a1-py2.4.egg/zope/app/keyreference/testing.py", line 41, in __cmp__
TypeError: set objects are unhashable
Index: src/lovely/relation/property.py
===================================================================
--- src/lovely/relation/property.py (revision 82673)
+++ src/lovely/relation/property.py (working copy)
@@ -171,7 +171,7 @@
            self.util.remove(rel.next())

        for addT in list(self.resolveValueTokens(addST, 'sources')):
- rel = self._instantiateRelation(addST, [relType], target)
+ rel = self._instantiateRelation(addT, [relType], target)
            self.util.add(rel)

    def setSourceRelations(self, source, relations, relType):

Revision history for this message
Jürgen Kartnaller (jukart) wrote :

Thanks for pointing this out.

Fixed and tests added.

New version available at download,zope,org version 1.1.3

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.