Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[feat] Database Option #1559

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

Closed

Conversation

luchiago
Copy link
Contributor

Feature requested in the #1467. I added a new option in print_settings.py to show the current database. But we need to approve and merge the #1553 PR, because I made some refactoring in this file through this PR

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 71.528% when pulling a54fa42 on luchiago:feat/database-option into d747e09 on django-extensions:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 71.528% when pulling a54fa42 on luchiago:feat/database-option into d747e09 on django-extensions:master.

parser.add_argument(
'--show-secrets',
default=DEFAULT_SECRETS,
dest='show secrets',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not use spaces, use underscores.

@staticmethod
def get_defaults(options):
a_options = [
options.get('show secrets', DEFAULT_SECRETS),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not use spaces, use underscores.

@staticmethod
def safe_settings():
try:
return SafeExceptionReporterFilter().get_safe_settings()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If django < 3.0 does not have this class then the import above will already have failed and this code is meaningless.

Either the comment below is wrong or we should catch ImportError during importing.

FYI: This entire code can be replaced to function at startup time which seem to be preferred to this way if it served no additional function.

@@ -47,11 +47,17 @@ def add_arguments(self, parser):
type=bool,
help="Specifies if should be revealed the value of secrets",
)
parser.add_argument(
"--database",
dest="show database",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no spaces, just underscores :-)

@trbs
Copy link
Member

trbs commented Jul 29, 2020

I guess I don't understand what purpose this PR serves... DATABASES is already included on the output of print_settings ?

@luchiago
Copy link
Contributor Author

I guess I don't understand what purpose this PR serves... DATABASES is already included on the output of print_settings ?

@trbs As I said on #1467, I misunderstand the purpose. Let's close this PR and I can do the right one.

@trbs trbs closed this Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants