Skip to content

Commit 5973bbc

Browse files
committed
Add docstrings for model properties
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
1 parent d70a931 commit 5973bbc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

vulnerabilities/models.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,17 @@ def generate_vulcoid(timestamp=None):
7474

7575
@property
7676
def vulnerable_to(self):
77+
"""
78+
Returns packages which are vulnerable to this vulnerability.
79+
"""
7780
return self.vulnerable_packages.all()
7881

7982
@property
8083
def resolved_to(self):
84+
"""
85+
Returns packages, which first received patch against this vulnerability
86+
in their particular version history.
87+
"""
8188
return self.patched_packages.all()
8289

8390
def __str__(self):
@@ -132,10 +139,16 @@ class Package(PackageURLMixin):
132139

133140
@property
134141
def vulnerable_to(self):
142+
"""
143+
Returns vulnerabilities which are affecting this package.
144+
"""
135145
return self.vulnerabilities.all()
136146

137147
@property
138148
def resolved_to(self):
149+
"""
150+
Returns the vulnerabilities which this package is patched against.
151+
"""
139152
return self.resolved_vulnerabilities.all()
140153

141154
class Meta:

0 commit comments

Comments
 (0)