def getSingleInfo(table, movieID, infoType, notAList=False):
 infoTypeID = InfoType.select((InfoType.q.info == infoType))
 if (infoTypeID.count() == 0):
  return {}
 res = table.select(AND((table.q.movieID == movieID), (table.q.infoTypeID == infoTypeID[0].id)))
 retList = []
 for r in res:
  info = r.info
  note = r.note
  if note:
   info += (u'::%s' % note)
  retList.append(info)
 if (not retList):
  return {}
 if (not notAList):
  return {infoType: retList}
 else:
  return {infoType: retList[0]}

def getSingleInfo ( table , movieID , infoType , notAList = False ) : infoTypeID = InfoType . select ( ( InfoType . q . info == infoType ) ) if ( infoTypeID . count ( ) == 0 ) : return { } res = table . select ( AND ( ( table . q . movieID == movieID ) , ( table . q . infoTypeID == infoTypeID [ 0 ] . id ) ) ) retList = [ ] for r in res : info = r . info note = r . note if note : info += ( u'::%s' % note ) retList . append ( info ) if ( not retList ) : return { } if ( not notAList ) : return { infoType : retList } else : return { infoType : retList [ 0 ] }
return a dictionary in the form {infotype: infolistorstring} .