Opened 7 years ago

Closed 7 years ago

#13178 closed (duplicate)

Make YAML serializer prefer block mode over inline mode

Reported by: Patryk Zawadzki 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:

Description

Currently:

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

After the change:

$ ./manage.py dumpdata invoicing.customer --format=yaml
- fields:
    address: bar
    company: 1
    contact: ''
    deleted_at: null
    email: foo@bar.com
    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 Patryk Zawadzki 7 years ago.
Proposed patch

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by Patryk Zawadzki

Proposed patch

comment:1 Changed 7 years ago by Karen Tracey

milestone: 1.2

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

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

Duplicate of #11927

comment:3 Changed 7 years ago by Patryk Zawadzki

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 7 years ago by Russell Keith-Magee

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top