def get_bpd(records, **kwargs): result = [] for record in records: if record['record_type'] in ['bpd', 'bpc']: record = vault.extend_record(record) mention_date = record.get('mention_date') if mention_date: date = helpers.format_date(mention_date) else: date = 'never' result.append({ 'date': date, 'status': record['lifecycle_status'], 'metric': record.get('mention_count') or 0, 'id': record['name'], 'name': record['name'], 'link': helpers.make_blueprint_link(record['module'], record['name']) }) result.sort(key=lambda x: x['metric'], reverse=True) utils.add_index(result) return result
def get_translations(records,**kwargs): print ('what records %s' %records) for item in records: print ('####Here print the details on by one ###############') print ('record details %s ' %str(item)) result = [] for record in records: if record.record_type in ['bpd', 'bpc']: record = vault.extend_record(record) mention_date = record.get('mention_date') if mention_date: date = helpers.format_date(mention_date) else: date = 'never' result.append({ 'date': date, 'status': record['lifecycle_status'], 'metric': record.get('mention_count') or 0, 'id': record['name'], 'name': record['name'], 'link': helpers.make_blueprint_link(record['module'], record['name']) }) result.sort(key=lambda x: x['metric'], reverse=True) utils.add_index(result) return result