Esempio n. 1
0
 def map_inner(self, key, data):
     db_rec = NpmMetadata()
     db_rec.name = key
     db_rec.versions_json = data.get('versions')
     db_rec.latest = data.get('latest')
     db_rec.sourcepkg = data.get('sourcepkg')
     db_rec.origins_json = data.get('origins')
     db_rec.lics_json = data.get('lics')
     return db_rec
Esempio n. 2
0
 def map_inner(self, key, data):
     db_rec = NpmMetadata()
     db_rec.name = key[:255]
     db_rec.versions_json = data.get("versions")
     db_rec.latest = data.get("latest")[:255] if data.get(
         "latest") else None
     db_rec.sourcepkg = (data.get("sourcepkg")[:255]
                         if data.get("sourcepkg") else None)
     db_rec.origins_json = data.get("origins")
     db_rec.lics_json = data.get("lics")
     return db_rec