def serialize_revision(node, record, version, index, anon=False):
 if anon:
  user = None
 else:
  user = {u'name': version.creator.fullname, u'url': version.creator.url}
 return {u'user': user, u'index': (index + 1), u'date': version.date_created.isoformat(), u'downloads': record.get_download_count(version=index), u'md5': version.metadata.get(u'md5'), u'sha256': version.metadata.get(u'sha256')}

def serialize_revision ( node , record , version , index , anon = False ) : if anon : user = None else : user = { u'name' : version . creator . fullname , u'url' : version . creator . url } return { u'user' : user , u'index' : ( index + 1 ) , u'date' : version . date_created . isoformat ( ) , u'downloads' : record . get_download_count ( version = index ) , u'md5' : version . metadata . get ( u'md5' ) , u'sha256' : version . metadata . get ( u'sha256' ) }
serialize revision for use in revisions table .