Opened 8 years ago

Last modified 8 years ago

#26316 closed Cleanup/optimization

Remove repetition of code in migrations.operations.models — at Version 1

Reported by: Akshesh Doshi Owned by: nobody
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 (1)

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.

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