#22257: Write to specified file for dumpdata -------------------------------------+------------------------------------- Reporter: Gwildor | Owner: Type: New feature | anubhav9042 Component: Core (Management | Status: assigned commands) | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Gwildor): Replying to [comment:6 loic84]: > > Add an option to specify a file name to write the output to (under the current working directory) > > Why under the current working directory? `open()` does the right thing by default, if given a relative path, it'll use the current working directory. The current working directory could very much be readonly, and requiring people to `cd` to target a specific directory is not practical. > > From a quick look at the patch, I think it does the right thing. I'm sorry, this was what I meant. So you can also do `-o ../dumps/dump.json`, or something alike. Patch indeed looks good on that matter. About the default: I agree that defaulting to `stdout` is the way to go to maintain backwards compatibility. The main reason I opted for generating a filename and using that when not specific, is in the light of ticket #22258. -- Ticket URL: <https://code.djangoproject.com/ticket/22257#comment:7> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.75a3873a61df338f0c85d96543894fad%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.