Opened 15 years ago

Closed 15 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: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 15 years ago.
Proposed patch

Download all attachments as: .zip

Change History (5)

by Patryk Zawadzki, 15 years ago

Proposed patch

comment:1 by Karen Tracey, 15 years ago

milestone: 1.2

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

comment:2 by Russell Keith-Magee, 15 years ago

Duplicate of #11927

comment:3 by Patryk Zawadzki, 15 years ago

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

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