Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

Saving files information as the part of models #90

Open
singh1114 opened this issue Aug 21, 2017 · 2 comments
Open

Saving files information as the part of models #90

singh1114 opened this issue Aug 21, 2017 · 2 comments

Comments

@singh1114
Copy link
Collaborator

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
Copy link
Collaborator Author

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

@singh1114
Copy link
Collaborator Author

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 added a commit to singh1114/scancode-server that referenced this issue Aug 22, 2017
Signed-off-by: Ranvir Singh ranvir.singh1114@gmail.com
singh1114 added a commit to singh1114/scancode-server that referenced this issue Aug 23, 2017
* Remove scan_error field from ScannedFile model
* change the corresponding migrations

Signed-off-by: Ranvir Singh ranvir.singh1114@gmail.com
singh1114 added a commit to singh1114/scancode-server that referenced this issue Aug 24, 2017
* Change the models to add defaults to BooleanFields
* Change the migrations due to changes in the models

Signed-off-by: Ranvir Singh ranvir.singh1114@gmail.com
Monal5031 pushed a commit to Monal5031/scancode-server that referenced this issue Dec 1, 2017
Signed-off-by: Ranvir Singh ranvir.singh1114@gmail.com
Monal5031 pushed a commit to Monal5031/scancode-server that referenced this issue Dec 1, 2017
* Remove scan_error field from ScannedFile model
* change the corresponding migrations

Signed-off-by: Ranvir Singh ranvir.singh1114@gmail.com
Monal5031 pushed a commit to Monal5031/scancode-server that referenced this issue Dec 1, 2017
* Change the models to add defaults to BooleanFields
* Change the migrations due to changes in the models

Signed-off-by: Ranvir Singh ranvir.singh1114@gmail.com
singh1114 added a commit to singh1114/scancode-server that referenced this issue Dec 3, 2017
Signed-off-by: Ranvir Singh ranvir.singh1114@gmail.com
singh1114 added a commit to singh1114/scancode-server that referenced this issue Dec 3, 2017
* Remove scan_error field from ScannedFile model
* change the corresponding migrations

Signed-off-by: Ranvir Singh ranvir.singh1114@gmail.com
singh1114 added a commit to singh1114/scancode-server that referenced this issue Dec 3, 2017
* Change the models to add defaults to BooleanFields
* Change the migrations due to changes in the models

Signed-off-by: Ranvir Singh ranvir.singh1114@gmail.com
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant