scancode-server icon indicating copy to clipboard operation
scancode-server copied to clipboard

Saving files information as the part of models

Open singh1114 opened this issue 8 years ago • 2 comments
trafficstars

So, we can apply the following command into the terminal to get all the information about the files to be scanned before the real scan is applied. The results include every information about the file. For example, I applied this command in the root directory of this codebase.

scancode --info -f json-pp cc0-1.0.LICENSE

Result

{
  "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
  "scancode_version": "2.0.1",
  "scancode_options": {
    "--info": true,
    "--license-score": 0,
    "--ignore": [],
    "--format": "json-pp"
  },
  "files_count": 1,
  "files": [
    {
      "path": "scancode-server/cc0-1.0.LICENSE",
      "type": "file",
      "name": "cc0-1.0.LICENSE",
      "base_name": "cc0-1.0",
      "extension": ".LICENSE",
      "date": "2017-08-19",
      "size": 6433,
      "sha1": "172444e7c137eb5cd3cae530aca0879c90f7fada",
      "md5": "57f047ea87f405486a94bc5a56ba7fcf",
      "files_count": null,
      "mime_type": "text/plain",
      "file_type": "ASCII text",
      "programming_language": "Text only",
      "is_binary": false,
      "is_text": true,
      "is_archive": false,
      "is_media": false,
      "is_source": true,
      "is_script": false,
      "scan_errors": []
    }
  ]
}

Well, the task is to store whole of these things into the models.

singh1114 avatar Aug 21 '17 18:08 singh1114

@pombredanne, Should we include a single JSONField to add the whole of that stuff or should we create another different model?

singh1114 avatar Aug 21 '17 18:08 singh1114

According to the discussion on official gitter channel we came to the conclusion that we are going to use the different fields for each attribute.

singh1114 avatar Aug 22 '17 19:08 singh1114