Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop if model includes more than one relations to self #197

Open
kosdmit opened this issue Jul 23, 2024 · 0 comments
Open

Infinite loop if model includes more than one relations to self #197

kosdmit opened this issue Jul 23, 2024 · 0 comments

Comments

@kosdmit
Copy link

kosdmit commented Jul 23, 2024

backend: mixer.backend.django

I get an infinite loop then I try to create objects for model with two ForeignKey fields and relation to self.

For example:
command mixer.blend(SAPDepartment) with the model:

class SAPDepartment(models.Model):
    sap_name = models.CharField(max_length=150, null=False, blank=False)
    sap_id = models.IntegerField()
    upper_dep = models.ForeignKey('self', related_name='low_dep', on_delete=models.SET_NULL, null=True)
    main_dep = models.ForeignKey('self', related_name='main_department', on_delete=models.SET_NULL, null=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant