gregmuellegger/django-autofixture

Refactor `Link` class.

Opened this issue · 2 comments

The Link class in base.py is an arcane relict from four years ago and hard to understand.

We should try to remove the class in incorporate the logic into the Autofixture class.

Do you have any ideas bout how it should be refactored?

Hm, let's see. The Link class is only used in the AutoFixtureBase class. So the functionality could be provided by methods of this class.

We would need to figure out which methods of Link are currently used in which places of AutoFixtureBase and replace those. These include things like if field.name in self.generate_fk (Line 269 in base.py, where self.generate_fk is an instance of Link

What do you think?