Ignore:
Timestamp:
01/04/12 14:16:41 (8 years ago)
Author:
mnagni
Message:

Complete - # 22390: AMEND MOLES2 -> CEDA Moles Author and Co-author migration (plus PI assignment) to CEDA Observation record
 http://team.ceda.ac.uk/trac/ceda/ticket/22390
Incomplete - # 22392: citation migration from MOLES2
 http://team.ceda.ac.uk/trac/ceda/ticket/22392

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/ascore/utils.py

    r8194 r8202  
    44@author: mnagni 
    55''' 
     6from sqlalchemy.orm.collections import InstrumentedList 
    67def has_value(item): 
    78    if item is not None: 
     
    2021def _convertCollectionToList(tupleToHash, processedItems = []):  
    2122    toHash = [] 
     23    if tupleToHash is not None and type(tupleToHash) != tuple and type(tupleToHash) != list \ 
     24        and type(tupleToHash) != InstrumentedList and type(tupleToHash) != dict: 
     25        processedItems.append(tupleToHash) 
     26        toHash.append(tupleToHash) 
     27        return toHash 
     28     
    2229    for item in tupleToHash: 
    2330        if item in processedItems: 
    2431            continue 
    2532        processedItems.append(item) 
    26         if type(item) == tuple or type(item) == list: 
     33        if type(item) == tuple or type(item) == list or type(item) == InstrumentedList: 
    2734            for innerItem in item: 
    2835                toHash.extend(_convertCollectionToList(innerItem, processedItems)) 
Note: See TracChangeset for help on using the changeset viewer.