You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The refactors are based on #525 (review)
- class Inference: order should be the logic order from most important to least important fields
- class Improver: docs
- data_source.py: Use to_dict() than json()
- models: Advisory: docs
- improvers/nginx.py: Removed, relevant improvers will now reside inside
importer module. In this case, importers/nginx.py
- black formatting
Signed-off-by: Hritik Vijay <hritikxx8@gmail.com>
Copy file name to clipboardExpand all lines: vulnerabilities/models.py
+16-7Lines changed: 16 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -320,10 +320,19 @@ class Meta:
320
320
321
321
322
322
classAdvisory(models.Model):
323
-
date_published=models.DateField()
324
-
date_collected=models.DateField()
325
-
source=models.CharField(max_length=100)
326
-
improved_on=models.DateTimeField(null=True)
327
-
improved_times=models.IntegerField(default=0)
328
-
# data would contain a data_source.AdvisoryData
329
-
data=models.JSONField()
323
+
"""
324
+
An advisory directly obtained from upstream without any modifications.
325
+
"""
326
+
327
+
date_published=models.DateField(help_text="Date of publication of the advisory")
328
+
date_collected=models.DateField(help_text="Date on which the advisory was collected")
329
+
source=models.CharField(
330
+
max_length=100,
331
+
help_text="Fully qualified name of the importer prefixed with the module name importing the advisory. Eg: vulnerabilities.importers.nginx.NginxDataSource",
332
+
)
333
+
date_improved=models.DateTimeField(
334
+
null=True, help_text="Latest date on which the advisory was improved by an improver"
335
+
)
336
+
data=models.JSONField(
337
+
help_text="Contents of data_source.AdvisoryData serialized as a JSON object"
0 commit comments