Opened 7 years ago

Last modified 11 months ago

#11927 assigned New feature

Allow manage.py dumpdata to dump YAML in block style

Reported by: sampablokuper Owned by: Xiao Hanyu
Component: Core (Serialization) Version: master
Severity: Normal Keywords:
Cc: sam.kuper@… Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Using

python manage.py dumpdata --format=yaml

produces output in flow style. That's OK for automated processing, but it isn't anything like as human-readable as block style YAML. For people who, like me, need to edit the fixtures manually, it would be very useful to be able to do something like:

python manage.py dumpdata --format=yaml --flowstyle=false

Attachments (2)

flow_style.patch (642 bytes) - added by Aviral Dasgupta 7 years ago.
yaml_dump_style.diff (2.8 KB) - added by Aviral Dasgupta 6 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 7 years ago by sampablokuper

Cc: sam.kuper@… added

Added to CC list.

comment:2 Changed 7 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

Changed 7 years ago by Aviral Dasgupta

Attachment: flow_style.patch added

comment:3 Changed 7 years ago by Aviral Dasgupta

Has patch: set
Owner: changed from nobody to Aviral Dasgupta

comment:4 Changed 7 years ago by Aviral Dasgupta

Needs documentation: set
Needs tests: set
Patch needs improvement: set

comment:5 Changed 7 years ago by Aviral Dasgupta

milestone: 1.3
Resolution: fixed
Status: newclosed

comment:6 Changed 7 years ago by Karen Tracey

Resolution: fixed
Status: closedreopened

It's not fixed until the code is checked into SVN.

comment:7 Changed 6 years ago by Ramiro Morales

Current patch simply changes situation from hardcoded flow style output to hardcoded not flow styled output and this isn't really an overall enhancement. This should be selectable from the command line (defaulting to the current style?) as proposed by the OP. Otherwise IMHO it has little changes of being committed.

Changed 6 years ago by Aviral Dasgupta

Attachment: yaml_dump_style.diff added

comment:8 Changed 6 years ago by Aviral Dasgupta

Patch needs improvement: unset
Version: 1.1SVN

Okay, I've added a new patch. With this one, you can use --flowstyle for flow style and --blockstyle for block style YAML dumps.

comment:9 Changed 6 years ago by Łukasz Rekucki

milestone: 1.3

It still needs docs and tests. Also, it's a feature, so not going to make it for 1.3;

comment:10 Changed 6 years ago by Russell Keith-Magee

Patch needs improvement: set

I'm also not wild about the idea of having 2 options to control one flag. You can't specify both --flow and --block, so why have two options? I'd rather see just --block (enabling the new block style), or if there are likely to be more styling options, a --style=block argument.

comment:11 Changed 6 years ago by Julien Phalip

Severity: Normal
Type: New feature

comment:12 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:13 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:14 Changed 5 years ago by Aviral Dasgupta

Owner: Aviral Dasgupta deleted
Status: reopenednew

comment:15 Changed 3 years ago by blockstyle@…

--blockstyle option not found?!! I'm dumping my fixtures as yaml. The flowstyle is a pita to see.
Why isn't it available? I'm using Django 1.6

comment:16 Changed 3 years ago by Simon Charette

This ticket patch needs improvement based on @russellm comments, tests and documentation.

comment:17 Changed 11 months ago by Xiao Hanyu

Owner: set to Xiao Hanyu
Status: newassigned
Note: See TracTickets for help on using tickets.
Back to Top