def format_element(bfo): """Returns how many times record was cited. If 0, returns nothing @param bfo BFO to extract data from """ citations = '' try: times_cited = get_one_cited_by_weight(bfo.recID) if times_cited != 0: citations = '%d citations counted in INSPIRE as of %s' % ( get_one_cited_by_weight(bfo.recID), get_lastupdated('citation').strftime("%d %b %Y")) except: pass return citations
def timestamp_verifier(): citation_lastupdate = get_lastupdated('citation') if citation_lastupdate: return citation_lastupdate.strftime("%Y-%m-%d %H:%M:%S") else: return "0000-00-00 00:00:00"
def format_element(bfo): """Returns how many times record was cited. If 0, returns nothing @param bfo BFO to extract data from """ citations = '' try: times_cited = get_one_cited_by_weight(bfo.recID) if times_cited != 0: citations = '%d citations counted in INSPIRE as of %s' % (get_one_cited_by_weight(bfo.recID), get_lastupdated('citation').strftime("%d %b %Y")) except: pass return citations