MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / get_or_none

Method get_or_none

vulnerabilities/models.py:94–99  ·  view source on GitHub ↗

Returns a single object matching the given keyword arguments, `None` otherwise.

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

92
93class BaseQuerySet(models.QuerySet):
94 def get_or_none(self, *args, **kwargs):
95 """
96 Returns a single object matching the given keyword arguments, `None` otherwise.
97 """
98 with suppress(self.model.DoesNotExist, ValidationError):
99 return self.get(*args, **kwargs)
100
101 def paginated(self, per_page=5000):
102 """

Callers 3

process_inferencesFunction · 0.80
process_inferencesFunction · 0.80
import_advisoryFunction · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected