Changeset 1902


Ignore:
Timestamp:
07/24/07 14:42:56 (12 years ago)
Author:
jukka
Message:

Deleting unused references didn't work. Refs #1468.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FieldsWidgets.py

    r1868 r1902  
    526526        plone_utils = getToolByName(instance, 'plone_utils') 
    527527        lt = getToolByName(instance, 'lemill_tool') 
    528         targetUIDs = tool.getReferences(instance, self.relationship) 
     528        targetUIDs = [x.targetUID for x in tool.getReferences(instance, self.relationship)] 
    529529        finalvalues=[] 
    530530        allowed_types_sequence=[''] 
     
    581581                        fine_piece = False                 
    582582 
    583                 # store UID in session so that we can edit these new pieces  
    584                 if fine_piece: 
    585                     session=instance.REQUEST.SESSION 
    586                     if session.has_key('new_pieces'): 
    587                         session['new_pieces'].append(new_piece.UID()) 
    588                     else: 
    589                         session['new_pieces']=[new_piece.UID()] 
    590  
    591583            #try to set references 
    592584            if type(chapter)==str: 
     
    604596 
    605597 
    606         for uid in targetUIDs: # delete bad references 
     598        for uid in targetUIDs: # delete bad references         
    607599            if uid not in uids: 
    608600                tool.deleteReference(instance, uid, self.relationship)             
Note: See TracChangeset for help on using the changeset viewer.