Skip to content

Commit

Permalink
Add docstrings for model properties
Browse files Browse the repository at this point in the history
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
  • Loading branch information
sbs2001 committed Apr 21, 2021
1 parent 8f2e1f7 commit 39fe25b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vulnerabilities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 39fe25b

Please sign in to comment.