Esempio n. 1
0
 def map_inner(self, key, data):
     db_rec = GemMetadata()
     db_rec.name = key
     db_rec.id = int(data.get('id')) if data.get('id') else -1
     db_rec.authors_json = data.get('authors')
     db_rec.versions_json = data.get('versions')
     db_rec.licenses_json = data.get('licenses')
     db_rec.latest = data.get('latest')
     return db_rec
Esempio n. 2
0
 def map_inner(self, key, data):
     db_rec = GemMetadata()
     db_rec.name = key[:255]
     db_rec.id = int(data.get("id")) if data.get("id") else -1
     db_rec.authors_json = data.get("authors")
     db_rec.versions_json = data.get("versions")
     db_rec.licenses_json = data.get("licenses")
     db_rec.latest = data.get("latest")[:255] if data.get("latest") else None
     return db_rec