Opened 7 years ago

Closed 7 years ago

#26151 closed Cleanup/optimization (fixed)

Refactor MigrationWriter.serialize()

Reported by: Yoong Kang Lim Owned by: Yoong Kang Lim
Component: Migrations Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The serializer() method in MigrationWriter has a McCabe Cyclomatic Complexity of 50, one of the highest in the entire Django code base.

The serialization logic should be in different Serializer classes. MigrationWriter.serialize() should call a Serializer Factory to obtain the correct Serializer for the value passed in.

Change History (5)

comment:1 Changed 7 years ago by Tim Graham

Has patch: set
Summary: Refactor MigrationWriterRefactor MigrationWriter.serialize()
Triage Stage: UnreviewedAccepted

comment:2 Changed 7 years ago by Markus Holtermann

Looks good on the first glimpse :) . I'll need a bit more time to actually look into it.

comment:3 Changed 7 years ago by Yoong Kang Lim

Owner: changed from nobody to Yoong Kang Lim
Status: newassigned

comment:4 Changed 7 years ago by Markus Holtermann

Since a discussion on #django-dev came up earlier I posted to the developer mailing list to get other people's input:!topic/django-developers/yGKl7ZkLac4

comment:5 Changed 7 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 4b1529e2:

Fixed #26151 -- Refactored MigrationWriter.serialize()

Thanks Markus Holtermann for review.

Note: See TracTickets for help on using tickets.
Back to Top