From 39fe25b9110d8416fa9cff38cd9f1799f6394076 Mon Sep 17 00:00:00 2001 From: Shivam Sandbhor Date: Mon, 19 Apr 2021 16:28:32 +0530 Subject: [PATCH] Add docstrings for model properties Signed-off-by: Shivam Sandbhor --- vulnerabilities/models.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vulnerabilities/models.py b/vulnerabilities/models.py index a86aab468..736ab9ee5 100644 --- a/vulnerabilities/models.py +++ b/vulnerabilities/models.py @@ -74,10 +74,17 @@ def generate_vulcoid(timestamp=None): @property def vulnerable_to(self): + """ + Returns packages which are vulnerable to this vulnerability. + """ return self.vulnerable_packages.all() @property def resolved_to(self): + """ + Returns packages, which first received patch against this vulnerability + in their particular version history. + """ return self.patched_packages.all() def __str__(self): @@ -132,10 +139,16 @@ class Package(PackageURLMixin): @property def vulnerable_to(self): + """ + Returns vulnerabilities which are affecting this package. + """ return self.vulnerabilities.all() @property def resolved_to(self): + """ + Returns the vulnerabilities which this package is patched against. + """ return self.resolved_vulnerabilities.all() class Meta: