-
-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataModel Plugin #2494
base: develop
Are you sure you want to change the base?
DataModel Plugin #2494
Conversation
Signed-off-by: 0ssigeno <[email protected]>
Signed-off-by: 0ssigeno <[email protected]>
Signed-off-by: 0ssigeno <[email protected]>
Signed-off-by: 0ssigeno <[email protected]>
Signed-off-by: 0ssigeno <[email protected]>
Signed-off-by: 0ssigeno <[email protected]>
Signed-off-by: 0ssigeno <[email protected]>
Signed-off-by: 0ssigeno <[email protected]>
Signed-off-by: 0ssigeno <[email protected]>
Signed-off-by: 0ssigeno <[email protected]>
Signed-off-by: 0ssigeno <[email protected]>
Signed-off-by: 0ssigeno <[email protected]>
The errors in the test are not related to the pr, you can review it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things to consider. View full project report here.
Signed-off-by: 0ssigeno <[email protected]>
|
||
|
||
class DataModelEvaluations(Choices): | ||
FALSE_POSITIVE = "false_positive" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FALSE_POSITIVE = "false_positive" | |
TRUSTED = "trusted" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth considering. View full project report here.
data_model_content_type = models.ForeignKey( | ||
ContentType, | ||
on_delete=models.CASCADE, | ||
limit_choices_to={ | ||
"app_label": "data_model_manager", | ||
}, | ||
null=True, | ||
editable=False | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data_model_content_type = models.ForeignKey( | |
ContentType, | |
on_delete=models.CASCADE, | |
limit_choices_to={ | |
"app_label": "data_model_manager", | |
}, | |
null=True, | |
editable=False | |
) | |
data_model_content_type = models.ForeignKey( | |
ContentType, | |
on_delete=models.CASCADE, | |
limit_choices_to={"app_label": "data_model_manager"}, | |
null=True, | |
editable=False, | |
blank=True, | |
) |
Django automatically creates a related_name
if it's not set. If it were set then a more readable and explicit relationship is set up. More details.
Expect unwanted behavior if null
and blank
are different values: null
controls if the database allows no value for data_model_content_type
and blank
controls if the application allows no value for data_model_content_type
. Consider setting null
and blank
to the same value for data_model_content_type
. Explained here.
null=True, | ||
editable=False | ||
) | ||
data_model_object_id = models.IntegerField(null=True, editable=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data_model_object_id = models.IntegerField(null=True, editable=False) | |
data_model_object_id = models.IntegerField(null=True, editable=False, blank=True) |
Same as above: Maybe setting null
and blank
to the same value.
(Please add to the PR name the issue/s that this PR would close if merged by using a Github keyword. Example:
<feature name>. Closes #999
. If your PR is made by a single commit, please add that clause in the commit too. This is all required to automate the closure of related issues.)Description
Please include a summary of the change and link to the related issue.
Type of change
Please delete options that are not relevant.
Checklist
develop
dumpplugin
command and added it in the project as a data migration. ("How to share a plugin with the community")test_files.zip
and you added the default tests for that mimetype in test_classes.py.FREE_TO_USE_ANALYZERS
playbook by following this guide.url
that contains this information. This is required for Health Checks._monkeypatch()
was used in its class to apply the necessary decorators.MockUpResponse
of the_monkeypatch()
method. This serves us to provide a valid sample for testing.Black
,Flake
,Isort
) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.tests
folder). All the tests (new and old ones) gave 0 errors.DeepSource
,Django Doctors
or other third-party linters have triggered any alerts during the CI checks, I have solved those alerts.Important Rules