Opened 6 years ago

Closed 6 years ago

#13178 closed (duplicate)

Make YAML serializer prefer block mode over inline mode

Reported by: patrys Owned by: nobody
Component: Core (Serialization) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:



$ ./ dumpdata invoicing.customer --format=yaml
- fields: {address: bar, company: 1, contact: '', deleted_at: null, email:,
    name: Foo, tax_id: ''}
  model: invoicing.customer
  pk: 1

After the change:

$ ./ dumpdata invoicing.customer --format=yaml
- fields:
    address: bar
    company: 1
    contact: ''
    deleted_at: null
    name: Foo
    tax_id: ''
  model: invoicing.customer
  pk: 1

It makes reading, understanding and editing of fixtures much easier (after all that's why we have YAML).

Attachments (1)

django-yaml-block-mode.patch (636 bytes) - added by patrys 6 years ago.
Proposed patch

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by patrys

Proposed patch

comment:1 Changed 6 years ago by kmtracey

  • milestone 1.2 deleted
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

At this point 1.2 is closed to all but critical bugs.

comment:2 Changed 6 years ago by russellm

Duplicate of #11927

comment:3 Changed 6 years ago by patrys

Yes, it seems to be a dupe. I searched before posting but I somehow missed #11927.

Anyway, I suggest applying this patch as a solution to #11927. If you need a compact format, JSON is there. We should prefer readability when using YAML.

comment:4 Changed 6 years ago by russellm

  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top