[Checkins] SVN: z3c.relationfieldui/trunk/src/z3c/relationfieldui/widget.py Use the new create_relation interface to create relation, now also

Martijn Faassen faassen at infrae.com
Mon Jan 19 15:06:39 EST 2009


Log message for revision 94859:
  Use the new create_relation interface to create relation, now also
  properly handling broken relations.
  

Changed:
  U   z3c.relationfieldui/trunk/src/z3c/relationfieldui/widget.py

-=-
Modified: z3c.relationfieldui/trunk/src/z3c/relationfieldui/widget.py
===================================================================
--- z3c.relationfieldui/trunk/src/z3c/relationfieldui/widget.py	2009-01-19 20:06:10 UTC (rev 94858)
+++ z3c.relationfieldui/trunk/src/z3c/relationfieldui/widget.py	2009-01-19 20:06:38 UTC (rev 94859)
@@ -42,21 +42,13 @@
     def _toFieldValue(self, input):
         if not input:
             return None
-        # convert path to Relation object
-        obj = self.resolve(input)
-        # XXX if obj is none, cannot create path
-        return create_relation(obj)
+        return create_relation(input)
 
     def _toFormValue(self, value):
         if value is None:
             return ''
         return value.to_path
 
-    def resolve(self, path):
-        object_path = component.getUtility(IObjectPath)
-        return object_path.resolve(path)
-
-
 class RelationDisplayWidget(grok.MultiAdapter, DisplayWidget):
     grok.adapts(IRelation, IBrowserRequest)
     grok.provides(IDisplayWidget)



More information about the Checkins mailing list