Opened 8 years ago

Closed 8 years ago

#26316 closed Cleanup/optimization (fixed)

Remove repetition of code in migrations.operations.models

Reported by: Akshesh Doshi Owned by: Akshesh Doshi
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: yes UI/UX: no

Description (last modified by Simon Charette)

The following method repeats 7 times in django.db.migations.operations.models:

    def references_model(self, name, app_label=None):
        return name.lower() == self.name_lower

I think it should be taken up to ModelOperation (or Operation maybe).

Change History (3)

comment:1 by Simon Charette, 8 years ago

Description: modified (diff)
Easy pickings: set
Triage Stage: UnreviewedAccepted

I think we should implement ModelOperation.references_model, FieldOperation.references_model and FieldOperation.references_field.

comment:2 by Akshesh Doshi, 8 years ago

Has patch: set
Owner: changed from nobody to Akshesh Doshi
Status: newassigned

comment:3 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In b886f166:

Fixed #26316 -- Factored duplicated code in model/field migration operations.

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