Opened 7 years ago

Last modified 5 months ago

#11927 assigned New feature

Allow dumpdata to dump YAML in block style

Reported by: sampablokuper Owned by: xiaohanyu
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



python 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 dumpdata --format=yaml --flowstyle=false

Attachments (2)

flow_style.patch (642 bytes) - added by aviraldg 6 years ago.
yaml_dump_style.diff (2.8 KB) - added by aviraldg 5 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 7 years ago by sampablokuper

  • Cc sam.kuper@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Added to CC list.

comment:2 Changed 6 years ago by russellm

  • Triage Stage changed from Unreviewed to Accepted

Changed 6 years ago by aviraldg

comment:3 Changed 6 years ago by aviraldg

  • Has patch set
  • Owner changed from nobody to aviraldg

comment:4 Changed 6 years ago by aviraldg

  • Needs documentation set
  • Needs tests set
  • Patch needs improvement set

comment:5 Changed 6 years ago by aviraldg

  • milestone set to 1.3
  • Resolution set to fixed
  • Status changed from new to closed

comment:6 Changed 6 years ago by kmtracey

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:7 Changed 5 years ago by ramiro

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 5 years ago by aviraldg

comment:8 Changed 5 years ago by aviraldg

  • Patch needs improvement unset
  • Version changed from 1.1 to SVN

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 5 years ago by lrekucki

  • milestone 1.3 deleted

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

comment:10 Changed 5 years ago by russellm

  • 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 5 years ago by julien

  • Severity set to Normal
  • Type set to New feature

comment:12 Changed 4 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:13 Changed 4 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:14 Changed 4 years ago by aviraldg

  • Owner aviraldg deleted
  • Status changed from reopened to new

comment:15 Changed 2 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 2 years ago by charettes

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

comment:17 Changed 5 months ago by xiaohanyu

  • Owner set to xiaohanyu
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.
Back to Top