Added comment explaining why finding details are in a separate documents to discourage uninformed refactoring in the future

This commit is contained in:
VakarisZ 2021-01-14 12:02:38 +02:00
parent 2dfcbb49d4
commit cd9d2904c5
1 changed files with 3 additions and 0 deletions

View File

@ -37,6 +37,9 @@ class Finding(Document):
test = StringField(required=True, choices=zero_trust_consts.TESTS)
status = StringField(required=True, choices=zero_trust_consts.ORDERED_TEST_STATUSES)
finding_type = StringField(required=True, choices=zero_trust_consts.FINDING_TYPES)
# Details are in a separate document in order to discourage pulling them when not needed
# due to performance.
details = GenericLazyReferenceField(choices=[MonkeyFindingDetails, ScoutSuiteFindingDetails], required=True)
# http://docs.mongoengine.org/guide/defining-documents.html#document-inheritance
meta = {'allow_inheritance': True}