-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
[GSOC] feat: auto-importing django shell #18158
base: main
Are you sure you want to change the base?
Conversation
4f90a52
to
4d9eb51
Compare
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.
Following up from my post on the forum :) You got this !
4d9eb51
to
abc0225
Compare
Thank you so much, @adamchainz, for the feedback. Currently, I'm concentrating on writing tests for these features. Do you have any references or suggestions on where to start? I'm considering creating new functions within the shellCommandTestCase to test the auto-imports. |
Yes, the tests should be within You can unit-test It seems the existing tests don't actually cover launching the various shells. I think it’s worth trying adding coverage, at least for the default |
* Deleted useless import_string function. * Gave precedence to earlier apps. * Loaded default imports with command option.
6ebc3af
to
b0a2562
Compare
Tried to fix CI error.
b0a2562
to
aa2080a
Compare
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.
Great work getting some tests written! 💪
ed82b68
to
cc7c5e8
Compare
Fixed CI. Ensured that command and stdin option had default imports. Removed useless get_apps_and_models method.
ca191f6
to
c2a6351
Compare
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.
Thanks for your continued iteration. I hope you learn some things from my comments here.
Thanks @adamchainz again for your reviews. I left some questions in the comments |
Deleted useless update_globals method. Deleted useless test. Minor improvements. Setted maxDiff to None. Updated installed apps for tests.
df3323c
to
a1582f0
Compare
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.
Hi @salvo-polizzi , Thankyou for your constants efforts on this! And special thanks to Adam for reviewing. This PR looks in a great shape already. 🥇
I finally have some time to push this further.
30f5b5d
to
07c514f
Compare
Fixed CI. Fixed CI (II). Fixed CI (III).
07c514f
to
10a17aa
Compare
Branch description
This would be an update of the existing Django shell that auto-imports models for you from your app/project. Also, the goal would be to allow the user to subclass this shell to customize its behavior and import extra things.
TODO
Checklist
main
branch.