Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow list_model_info with to target multiple --models from the commandline#1792

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
cb109 wants to merge1 commit intodjango-extensions:main
base:main
Choose a base branch
Loading
fromcb109:list_model_info/target-multiple-models-with-cli-option

Conversation

@cb109
Copy link

@cb109cb109 commentedJan 19, 2023
edited
Loading

I wanted to output thelist_model_info for some of our models (we have hundreds), but currently can a) either outputall of them or b) call the commandonce per--model. I found that non-intuitive and would much prefer to be able to specify the desired models in a single command.

This PR changeslist_model_info --model app.Model tolist_model_info --models app1.Model1,app2.Model2,app3.Model3.

Since Django's management commands useargparse with a forgiving CLI option config, the old--model option will still work the exact same way as before (as it will match to the new --models), thus the change is backwards compatible.

Maybe it's worth thinking about something like this? The API could be different (e.g. support using--model more than once, or
handle multiple arguments, or a separate option).

It can then be used like:    python manage.py list_info_model --models app1.Model1,app2.Model2Since Django's management commands use argparse with a forgiving CLIoption config, the old --model option will still work the exact sameway as before (as it will match to the new --models), thus the change isbackwards compatible.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@cb109

[8]ページ先頭

©2009-2025 Movatter.jp