def get_viewables (item, priority=[]): """Return a list of possible viewable resources for an item""" R = userexit.resource_viewer_select (Director, item) if R: return R viewables = Config.get (config_fields).data return [ (key, item[key], item [key].get_url ()) for key in priority + viewables if item.has_key (key)]
def is_viewable (item): if userexit.resource_viewer_select (Director, item): return True for i in Config.get (config_fields).data: if item.has_key (i): return True